您好,我在安装Caffe时遇到问题。我按照说明https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-Installation-Guide(针对CPU版本)进行了所有操作 在命令中输入以下内容:
CXX src/caffe/util/io.cpp
In file included from /usr/local/include/opencv2/core.hpp:52:0,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/cvdef.h:421:4: error: #error "OpenCV 4.x+ requires enabled C++11 support"
# error "OpenCV 4.x+ requires enabled C++11 support"
^
In file included from /usr/include/c++/5/array:35:0,
from /usr/local/include/opencv2/core/cvdef.h:426,
from /usr/local/include/opencv2/core.hpp:52,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^
In file included from /usr/local/include/opencv2/core/base.hpp:58:0,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/cvstd.hpp:389:12: error: expected ‘,’ or ‘...’ before ‘&&’ token
Ptr(Ptr&& o);
^
/usr/local/include/opencv2/core/cvstd.hpp:389:16: error: invalid constructor; you probably meant ‘cv::Ptr<T> (const cv::Ptr<T>&)’
Ptr(Ptr&& o);
^
/usr/local/include/opencv2/core/cvstd.hpp:390:25: error: expected ‘,’ or ‘...’ before ‘&&’ token
Ptr& operator = (Ptr&& o);
^
In file included from /usr/local/include/opencv2/core/cvstd.hpp:1033:0,
from /usr/local/include/opencv2/core/base.hpp:58,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/ptr.inl.hpp:256:16: error: expected ‘,’ or ‘...’ before ‘&&’ token
Ptr<T>::Ptr(Ptr&& o) : owner(o.owner), stored(o.stored)
^
/usr/local/include/opencv2/core/ptr.inl.hpp:256:1: error: prototype for ‘cv::Ptr<T>::Ptr(cv::Ptr<T>)’ does not match any in class ‘cv::Ptr<T>’
Ptr<T>::Ptr(Ptr&& o) : owner(o.owner), stored(o.stored)
^
In file included from /usr/local/include/opencv2/core/base.hpp:58:0,
from /usr/local/include/opencv2/core.hpp:54,
from /usr/local/include/opencv2/core/core.hpp:48,
from src/caffe/util/io.cpp:6:
/usr/local/include/opencv2/core/cvstd.hpp:319:5: error: candidates are: template<class T> template<class Y> cv::Ptr<T>::Ptr(const cv::Ptr<Y>&, T*)
Ptr(const Ptr<Y>& o, T* p);
输出中也有很多文本,但是由于字符数限制,我无法上传
Makefile:591: recipe for target '.build_release/src/caffe/util/io.o' failed
make: *** [.build_release/src/caffe/util/io.o] Error 1
有人可以帮助我解决这个问题吗?
OS:Ubuntu 16.04 cmake版本3.5.1 CUDA版本:10.0.130
答案 0 :(得分:0)
问题出在OpenCV的第4版中。 Caffe无法使用它。当我安装第三个版本时,一切正常。