我"导入caffe"来自ipython,但我得到了#34; RuntimeWarning"。如何解决?

时间:2016-03-06 05:59:51

标签: caffe pycaffe

我已经阅读了文章" Ubuntu安装 - 使用64位处理器的Ubuntu 14.04指南。"来自Github网站(https://github.com/tiangolo/caffe/blob/ubuntu-tutorial-b/docs/install_apt2.md)。 现在,我打开IPython来测试PyCaffe是否正常工作。我输入" ipython"命令,并进入ipython页面。

然后,我输入命令" import caffe",但我得到了以下警告:

  

/root/code/caffe-master/python/caffe/pycaffe.py:13:RuntimeWarning:to :: Python converter for boost :: shared_ptr>已经登记了;忽略第二种转换方法。来自._caffe import Net,SGDSolver,NesterovSolver,AdaGradSolver,\

     

/root/code/caffe-master/python/caffe/pycaffe.py:13:运行时警告:to :: Python转换器,用于boost :: shared_ptr>已经登记了;忽略第二种转换方法。来自._caffe import Net,SGDSolver,NesterovSolver,AdaGradSolver,\

     

/root/code/caffe-master/python/caffe/pycaffe.py:13:运行时警告:to :: Python转换器,用于boost :: shared_ptr>已经登记了;忽略第二种转换方法。来自._caffe import Net,SGDSolver,NesterovSolver,AdaGradSolver,\

请您帮我解决一些建议吗?

2 个答案:

答案 0 :(得分:2)

我发现了这个:

https://groups.google.com/forum/#!topic/caffe-users/C_air48cISU

声称这是一个非错误,导致错误匹配的Boost版本。你可以放心地忽略它。他们已承诺清理警告(在某些时候尚未指定)

答案 1 :(得分: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> > >();
      }

然后编译使用'make pycaffe',它会没问题。