Caffe编译报错

版权声明:如需转载请评论告知并标明出处 https://blog.csdn.net/ShuqiaoS/article/details/83268237

Caffe编译报错

博主在修改了电脑环境后重新编译之前项目的Caffe,出现了几个小错误,在此记录下来。注意,在每次修改后都需要运行 make clean'再重新make。更新于2018.10.22。

1

make: *** No rule to make target '/usr/include/google/protobuf/stubs/common.h', needed by '.build_release/cuda/src/caffe/solvers/adam_solver.o'。 停止。

由于protobuf的默认安装目录是/usr/local/,而caffe的搜索目录是/usr/,因此需要重新安装protobuf,将./configure改成./configure --prefix=/usr即可。

卸载

which protoc 
rm /usr/local/bin/protoc

安装

下载https://github.com/google/protobuf/releases ##Source code (zip)##
./autogen.sh
./configure --prefix=/usr
make
make check
sudo make install

2

caffe/proto/caffe.pb.h: 没有那个文件或目录

可能是make太快的缘故,将make -j 8改成make -j 5。

3

#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.

修改Makefile中的COMMON_FLAGS选项,在最后加上-std=c++11或-std=gnu++11。

猜你喜欢

转载自blog.csdn.net/ShuqiaoS/article/details/83268237
今日推荐