def prep_for_deploy(self, batch_size, source_net=False, target_net=False, deploy_fn='deploy.proto', caffemodel_fn='score.caffemodel', gpu_id=0):
caffe.set_mode_gpu()
caffe.set_device(gpu_id)
self.generate_deploy_proto(deploy_fn, batch_size, source_net=source_net, target_net=target_net)
self.deploy = caffe.Net(deploy_fn, caffe.TEST, weights=caffemodel_fn)
self._set_semantics(self.deploy, source=False, init_cw=False)
self._set_semantics(self.deploy, source=True, init_cw=False)
评论列表
文章目录