solver.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:deep_share 作者: luyongxi 项目源码 文件源码
def _load_solver(self, solver_params, model_params):
        """ Load solver """
        solver_path = solver_params.path
        if model_params.max_rounds > 1:
            if self._cur_round > 0:
                solver_path = osp.join(osp.dirname(solver_path), 'round_{}'.format(self._cur_round))
            else:
                solver_path = osp.join(solver_path, 'round_{}'.format(self._cur_round))
            solver_params.set_path(solver_path)

        model = model_params.model
        if model is not None:
            model.to_proto(solver_path, deploy=False)
            model.to_proto(solver_path, deploy=True)
            print 'Model files saved at {}'.format(solver_path)

        return caffe.SGDSolver(solver_params.to_proto())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号