2016-03-06 25 views
2

我已阅读文章“Ubuntu安装 - 使用64位处理器的Ubuntu 14.04指南”。来自Github网站(https://github.com/tiangolo/caffe/blob/ubuntu-tutorial-b/docs/install_apt2.md)。 现在,我打开IPython来测试PyCaffe正在工作。我输入“ipython”命令,并进入ipython页面。我从ipython“导入caffe”,但我得到了“RuntimeWarning”。如何解决它?

然后,我输入命令 “进口朱古力”,但我得到了如下警告:

/root/code/caffe-master/python/caffe/pycaffe.py:13:RuntimeWarning:TO-用于boost :: shared_ptr>的Python转换器已经注册;忽略第二种转换方法。从._caffe进口网,SGDSolver,NesterovSolver,AdaGradSolver,\

/root/code/caffe-master/python/caffe/pycaffe.py:13:RuntimeWarning:到Python的转换器,升压:: shared_ptr的已注册> ;忽略第二种转换方法。 from ._caffe import net,SGDSolver,NesterovSolver,AdaGradSolver,\

/root/code/caffe-master/python/caffe/pycaffe.py:13:RuntimeWarning:to-Python converter for boost :: shared_ptr> already registered ;忽略第二种转换方法。 from ._caffe import net,SGDSolver,NesterovSolver,AdaGradSolver,\

请您帮忙给我一些解决它的建议吗?

回答

1

您可以编辑/caffe/python/caffe/_caffe.cpp。有四个地方需要改变,这样

bp::register_ptr_to_python<shared_ptr<Layer<Dtype> > >(); 

const boost::python::type_info cinfo = boost::python::type_id<shared_ptr<Blob<Dtype> > >(); 
const boost::python::converter::registration* creg = boost::python::converter::registry::query(cinfo); 
     if (creg == NULL) 
     { 
     bp::register_ptr_to_python<shared_ptr<Layer<Dtype> > >(); 
     } 
     else if ((*creg).m_to_python == NULL) { 
     bp::register_ptr_to_python<shared_ptr<Layer<Dtype> > >(); 
     } 

然后编译使用“让pycaffe”,这将是确定。

相关问题