/ / ipythonから「カフェをインポート」しましたが、「RuntimeWarning」を取得しました。解決するには? - カフェ、パイカフェ

私はipythonから "import caffe"を取得しましたが、 "RuntimeWarning"を取得しました。それを解決するには? - カフェ、ピカフェ

私は記事「Ubuntuのインストール - 64ビットプロセッサ搭載のUbuntu 14.04のためのガイド」を読みました。 Github Webサイト(https://github.com/tiangolo/caffe/blob/ubuntu-tutorial-b/docs/install_apt2.md) そして今、私はPyCaffeが機能していることをテストするためにIPythonを開きます。 「ipython」コマンドを入力して、ipythonページに入ります。

それから、 "import caffe"というコマンドを入力しましたが、以下の警告が表示されました。

/ root / code / caffe-master / python / caffe / pycaffe。py:13:RuntimeWarning:boost :: shared_ptrのPython変換ツールは既に登録されています。 2番目の変換方法は無視されます。ネット、SGDSolver、NesterovSolver、AdaGradSolver、

/ root / code / caffe-master / python / caffe / pycaffe。py:13:RuntimeWarning:boost :: shared_ptrのPython変換ツールは既に登録されています。 2番目の変換方法は無視されます。ネット、SGDSolver、NesterovSolver、AdaGradSolver、

/ root / code / caffe-master / python / caffe / pycaffe。py:13:RuntimeWarning:boost :: shared_ptrのPython変換ツールは既に登録されています。 2番目の変換方法は無視されます。ネット、SGDSolver、NesterovSolver、AdaGradSolver、

それを解決するためにいくつか提案をください。

回答:

回答№1は2

私はこれを見つけました:

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

これはエラーではないと主張し、Boostのバージョンが一致しないことが原因です。無視してかまいません。彼らは「(まだ特定されていない時点で)警告を一掃すると約束した


回答№2の場合は1

/caffe/python/caffe/_caffe.cppを編集できます。このように、変更が必要な箇所が4箇所あります。

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"を使ってコンパイルすれば大丈夫です。