在终端代开zshrc进行系统路径添加:
#anaconda2
export PATH=$PATH:"/home/fuxueping/anaconda2/bin"
Could NOT find PythonLibs: Found unsuitable version "2.7.15", but required is exact version "2.7.11" (found /usr/lib/x86_64-linux-gnu/libpython2.7.so)
Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.5", minimum required is "3.4")
Could NOT find PythonLibs: Found unsuitable version "2.7.15", but required is exact version "3.6.5" (found /usr/lib/x86_64-linux-gnu/libpython2.7.so)
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'numpy'
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/src/tbb/pipeline.cpp:21:0:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
Scanning dependencies of target opencv_highgui_pch_dephelp
make[2]: *** [3rdparty/tbb/CMakeFiles/tbb.dir/build.make:245:3rdparty/tbb/CMakeFiles/tbb.dir/tbb43_20141204oss/src/tbb/pipeline.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:364:3rdparty/tbb/CMakeFiles/tbb.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
[ 9%] Building CXX object modules/ts/CMakeFiles/opencv_ts_pch_dephelp.dir/opencv_ts_pch_dephelp.cxx.o
[ 9%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp.cxx.o
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/imgcodecs/src/precomp.hpp:48,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/imgcodecs/opencv_imgcodecs_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
make[2]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs_pch_dephelp.dir/build.make:72:modules/imgcodecs/CMakeFiles/opencv_imgcodecs_pch_dephelp.dir/opencv_imgcodecs_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:3743:modules/imgcodecs/CMakeFiles/opencv_imgcodecs_pch_dephelp.dir/all] 错误 2
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/src/precomp.hpp:55,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/core/opencv_core_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/imgproc/src/precomp.hpp:50,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/imgproc/opencv_imgproc_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/videoio/src/precomp.hpp:48,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/videoio/opencv_videoio_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
make[2]: *** [modules/imgproc/CMakeFiles/opencv_imgproc_pch_dephelp.dir/build.make:72:modules/imgproc/CMakeFiles/opencv_imgproc_pch_dephelp.dir/opencv_imgproc_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2114:modules/imgproc/CMakeFiles/opencv_imgproc_pch_dephelp.dir/all] 错误 2
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/test/test_precomp.hpp:17,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/core/opencv_test_core_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
make[2]: *** [modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/build.make:72:modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/opencv_core_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1333:modules/core/CMakeFiles/opencv_core_pch_dephelp.dir/all] 错误 2
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio_pch_dephelp.dir/build.make:72:modules/videoio/CMakeFiles/opencv_videoio_pch_dephelp.dir/opencv_videoio_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:4395:modules/videoio/CMakeFiles/opencv_videoio_pch_dephelp.dir/all] 错误 2
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/ts/src/precomp.hpp:2,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/ts/opencv_ts_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
make[2]: *** [modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/build.make:72:modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/opencv_test_core_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1252:modules/core/CMakeFiles/opencv_test_core_pch_dephelp.dir/all] 错误 2
In file included from /home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/tbb.h:65:0,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/core/include/opencv2/core/private.hpp:65,
from /home/fuxueping/sdb/software/opencv_3_1_0/modules/highgui/src/precomp.hpp:48,
from /home/fuxueping/sdb/software/opencv_3_1_0/build/modules/highgui/opencv_highgui_pch_dephelp.cxx:1:
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:74: note: suggested alternative: ‘is_trivially_copy_constructible’
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
is_trivially_copy_constructible
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:104: error: expected primary-expression before ‘>’ token
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^
/home/fuxueping/sdb/software/opencv_3_1_0/build/3rdparty/tbb/tbb43_20141204oss/include/tbb/pipeline.h:328:107: error: ‘::value’ has not been declared
template struct tbb_trivially_copyable { enum { value = std::has_trivial_copy_constructor::value }; };
^~~~~
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/build.make:72:modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/opencv_highgui_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:4629:modules/highgui/CMakeFiles/opencv_highgui_pch_dephelp.dir/all] 错误 2
make[2]: *** [modules/ts/CMakeFiles/opencv_ts_pch_dephelp.dir/build.make:72:modules/ts/CMakeFiles/opencv_ts_pch_dephelp.dir/opencv_ts_pch_dephelp.cxx.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:5581:modules/ts/CMakeFiles/opencv_ts_pch_dephelp.dir/all] 错误 2
/usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
NVCC src/caffe/layers/euclidean_loss_layer.cu
In file included from /usr/local/cuda/include/host_config.h:50:0,
from /usr/local/cuda/include/cuda_runtime.h:78,
from :0:
/usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
#error -- unsupported GNU version! gcc versions later than 6 are not supported!
^~~~~
In file included from /usr/local/cuda/include/common_functions.h:50:0,
from /usr/local/cuda/include/cuda_runtime.h:115,
from :0:
/usr/include/boost/config/compiler/nvcc.hpp:22:34: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions
#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500)
^
In file included from /usr/local/cuda/include/common_functions.h:50:0,
from /usr/local/cuda/include/cuda_runtime.h:115,
from :0:
/usr/include/boost/config/compiler/nvcc.hpp:22:34: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions
#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500)
^
make: *** [Makefile:591:.build_release/cuda/src/caffe/layers/euclidean_loss_layer.o] 错误 1
make: *** 正在等待未完成的任务....
make: *** [Makefile:591:.build_release/cuda/src/caffe/layers/crop_layer.o] 错误 1
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: 没有那个文件或目录
# include
^~~~~~~~~~~~
export CPLUS_INCLUDE_PATH=/usr/include/python2.7
dpkg -S /usr/include/boost/version.hpp
/usr/include/boost/config/compiler/nvcc.hpp:22:34: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions
#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500)
^
make: *** [Makefile:591:.build_release/cuda/src/caffe/layers/crop_layer.o] 错误 1
make: *** 正在等待未完成的任务....
In file included from /usr/local/cuda/include/common_functions.h:50:0,
from /usr/local/cuda/include/cuda_runtime.h:115,
from :0:
/usr/include/boost/config/compiler/nvcc.hpp:22:34: error: token ""__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead."" is not valid in preprocessor expressions
#if !defined(__CUDACC_VER__) || (__CUDACC_VER__ < 70500)
^
make: *** [Makefile:591:.build_release/cuda/src/caffe/layers/euclidean_loss_layer.o] 错误 1
/usr/bin/ld: 找不到 -lboost_python3
/usr/bin/ld: 找不到 -lpython3.5m
collect2: error: ld returned 1 exit status
make: *** [Makefile:569:.build_release/lib/libcaffe.so.1.0.0-rc3] 错误 1
python
/usr/bin/ld:找不到 -lboost_python
后续:自己要使用python3.6的libboost_pyhton3.so,但是执行了几遍都没有成功;最终解决:将系统默认的python转化为python 3.6版本,再运行就没有问题了。https://blog.csdn.net/bodybo/article/details/79962814第一句话“./bootstrap.sh --with-libraries=python --with-toolset=gcc”反应了boost找到的python版本;
./include/caffe/proto/caffe.pb.h:9:42: fatal error: google/protobuf/stubs/common.h: 没有那个文件或目录
#include
^
compilation terminated.
make: *** [Makefile:578:.build_release/src/caffe/layers/mvn_layer.o] 错误 1
make: *** 正在等待未完成的任务....
In file included from src/caffe/layers/data_layer.cpp:8:0:
./include/caffe/data_transformer.hpp:6:44: fatal error: google/protobuf/repeated_field.h: 没有那个文件或目录
#include "google/protobuf/repeated_field.h"
^
compilation terminated.
make: *** [Makefile:578:.build_release/src/caffe/layers/data_layer.o] 错误 1
In file included from ./include/caffe/blob.hpp:9:0,
from ./include/caffe/layers/sigmoid_cross_entropy_loss_layer.hpp:6,
from src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp:4:
.build_release/src/caffe/proto/caffe.pb.h:9:42: fatal error: google/protobuf/stubs/common.h: 没有那个文件或目录
#include
^
compilation terminated.
make: *** [Makefile:578:.build_release/src/caffe/layers/sigmoid_cross_entropy_loss_layer.o] 错误 1
In file included from ./include/caffe/blob.hpp:9:0,
from ./include/caffe/layers/smooth_L1_loss_layer.hpp:14,
from src/caffe/layers/smooth_L1_loss_layer.cpp:11:
.build_release/src/caffe/proto/caffe.pb.h:9:42: fatal error: google/protobuf/stubs/common.h: 没有那个文件或目录
#include
^
compilation terminated.
make: *** [Makefile:578:.build_release/src/caffe/layers/smooth_L1_loss_layer.o] 错误 1
In file included from ./include/caffe/blob.hpp:9:0,
from ./include/caffe/layers/batch_reindex_layer.hpp:7,
from src/caffe/layers/batch_reindex_layer.cpp:3:
.build_release/src/caffe/proto/caffe.pb.h:9:42: fatal error: google/protobuf/stubs/common.h: 没有那个文件或目录
#include
^
compilation terminated.
make: *** [Makefile:578:.build_release/src/caffe/layers/batch_reindex_layer.o] 错误 1
In file included from ./include/caffe/blob.hpp:9:0,
from ./include/caffe/filler.hpp:10,
from src/caffe/layers/scale_layer.cpp:4:
.build_release/src/caffe/proto/caffe.pb.h:9:42: fatal error: google/protobuf/stubs/common.h: 没有那个文件或目录
#include
^
解决方法:首先查看protobuf的版本,额嗯,由于caffe没有爸爸了,所以它使用的brotobuf版本较低,如果你电脑中的版本较高,可以将其先进行卸载,卸载命名行:
sudo apt-get autoremove libprotobuf-dev
查看protobuf版本的方法:
protoc --version
删除protobuf
1、用命令找到安装目录
which protoc
2、删除安装目录的安装包,例如下面的命令:
rm /usr/local/bin/protoc
参考:https://blog.csdn.net/jzw230726/article/details/80996922
编译报错:
使用编译好的caffe进行训练:
../../../build/tools/caffe: symbol lookup error:
/home/fuxueping/sdb/Caffe_Project_Train/caffe-
ssd2/.build_release/tools/../lib/libcaffe.so.1.0.0-rc3: undefined symbol:
_ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev
解决方法:
网上说是由于protobuf版本太低,参考:https://blog.csdn.net/yukaixuan520/article/details/81030608,所以对protobuf进行了卸载和重装;
但真实原因是由于电脑中安装了多个版本的brotobuf;这个原因也会在编译的时候报这个错误:
caffe.pb.h:17:2: 错误:#error This file was generated by an older version of protoc
如何确定有没有多版本冲突的问题,可以通过使用cmake-gui来编译caffe,查看protobuf的链接路径来解决:
上面的路径都是我重新填写的路径,当前路径是正确的;
同时protobuf的路径要在cmake文件夹下的ProtoBuf.cmake中进行重新填写,填写后是这样的(填写的两句是set开头的两句):
后续报错:
//usr/lib/libboost_python.so:对‘PyUnicodeUCS4_FromEncodedObject’未定义的引用
//usr/lib/libboost_python.so:对‘PyNumber_InPlaceDivide’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_Size’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_FromStringAndSize’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_InternFromString’未定义的引用
//usr/lib/libboost_python.so:对‘PyInt_AsLong’未定义的引用
//usr/lib/libboost_python.so:对‘PyUnicodeUCS4_AsWideChar’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_AsString’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_FromFormat’未定义的引用
//usr/lib/libboost_python.so:对‘PyClass_Type’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_FromString’未定义的引用
//usr/lib/libboost_python.so:对‘PyFile_AsFile’未定义的引用
//usr/lib/libboost_python.so:对‘Py_InitModule4_64’未定义的引用
//usr/lib/libboost_python.so:对‘PyInt_Type’未定义的引用
//usr/lib/libboost_python.so:对‘PyInt_FromLong’未定义的引用
//usr/lib/libboost_python.so:对‘PyFile_FromString’未定义的引用
//usr/lib/libboost_python.so:对‘PyNumber_Divide’未定义的引用
//usr/lib/libboost_python.so:对‘PyString_Type’未定义的引用
collect2: 错误:ld 返回 1
make[2]: *** [tools/CMakeFiles/caffe.bin.dir/build.make:126:tools/caffe] 错误 1
make[1]: *** [CMakeFiles/Makefile2:592:tools/CMakeFiles/caffe.bin.dir/all] 错误 2
make: *** [Makefile:130:all] 错误 2
报错原因是:libboost_python.so是python2.7生成的,而现在我使用的是python3.6;,所以需要对cmake中的boost中内容进行修改;