Ошибка Caffe OpenCV 3.1/Boost при выполнении команды make test

Я пытаюсь установить Caffe на свой Ubuntu 16.04 с поддержкой графического процессора (CUDA 8.0, CuDNN, OpenCV 3.1).

Когда я запускаю sudo make test при сборке Caffe, я получаю следующую ошибку:

.....................................

CXX src/caffe/test/test_net.cpp

NVCC src/caffe/test/test_im2col_kernel.cu

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use
-Wno-deprecated-gpu-targets to suppress warning).

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use
-Wno-deprecated-gpu-targets to suppress warning).

CXX src/gtest/gtest-all.cpp

CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp

.build_release/src/caffe/test/test_gradient_based_solver.o: In function `caffe::MakeTempDir(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':

test_gradient_based_solver.cpp:(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x56): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_gradient_based_solver.cpp:(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x8a): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_gradient_based_solver.cpp:

(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x124): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_gradient_based_solver.cpp:(.text._ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe11MakeTempDirEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x15a): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'

.build_release/src/caffe/test/test_hdf5_output_layer.o: In function `caffe::MakeTempFilename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)': test_hdf5_output_layer.cpp:

(.text._ZN5caffe16MakeTempFilenameEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5caffe16MakeTempFilenameEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1d4): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' .build_release/src/caffe/test/test_db.o: In function `caffe::DBTest<caffe::TypeLevelDB>::SetUp()': test_db.cpp:

(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0x7f): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_db.cpp:(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0xaf): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

test_db.cpp:

(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0x163): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_db.cpp:

(.text._ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv[_ZN5caffe6DBTestINS_11TypeLevelDBEE5SetUpEv]+0x19d): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'

.build_release/src/caffe/test/test_db.o: In function `caffe::DBTest<caffe::TypeLMDB>::SetUp()': test_db.cpp:(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0x7f): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_db.cpp:(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0xaf): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

test_db.cpp:

(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0x163): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_db.cpp:

(.text._ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv[_ZN5caffe6DBTestINS_8TypeLMDBEE5SetUpEv]+0x19d): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)' .build_release/src/caffe/test/test_upgrade_proto.o: In function `caffe::NetUpgradeTest_TestUpgradeV1LayerType_Test::TestBody()': test_upgrade_proto.cpp:(.text+0x2a21): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_upgrade_proto.cpp:(.text+0x2a5b): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_upgrade_proto.cpp:(.text+0x2b04): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_upgrade_proto.cpp:(.text+0x2b43): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'

.build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::CPUDevice<float>
>::TestBody()':

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x4d9): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x513): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x5c4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x603): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'

.build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::CPUDevice<double>
>::TestBody()':

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x4c1): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x4fb): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x5a4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x5e3): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)' .build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::GPUDevice<float>
>::TestBody()':

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x4d9): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)' test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x513): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x5c4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIfEEE8TestBodyEv]+0x603): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)' .build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::GPUDevice<double>
>::TestBody()': test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x4c1): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x4fb): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)' test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x5a4): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'

test_layer_factory.cpp:

(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9GPUDeviceIdEEE8TestBodyEv]+0x5e3): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'

collect2: error: ld returned 1 exit status

Makefile:599: recipe for target '.build_release/test/test_all.testbin' failed

make: *** [.build_release/test/test_all.testbin] Error 1

После некоторого времени поиска в Google я обнаружил, что это, вероятно, проблема с OpenCV, однако я не знаю, как ее решить.

Я собрал OpenCV 3.1 из исходного кода, следуя это руководство..

Я использую Anaconda2 с Python 2.7, и я создал виртуальную среду, используя conda (которую я назвал deep-learning), поэтому, когда я запускаю команду python в своем терминале и проверяю версию OpenCV, я получаю следующий вывод:

(deep-learning) ➜  caffe git:(master) ✗ python
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import cv2
>>> print cv2.__version__
3.1.0

Также я могу запустить файл opencv_version для проверки версии:

(deep-learning) ➜  caffe git:(master) ✗ /usr/local/bin/opencv_version 
3.1.0-dev

Вот мой процесс сборки Caffe (при условии, что я нахожусь в корневой папке Caffe):

sudo make clean
mkdir build
cd build
sudo cmake ..
cd ..
sudo make all
sudo make test

Все команды выполняются успешно, кроме sudo make test, которая выдает указанную выше ошибку.

Вот результат запуска sudo cmake ..:

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
  Imported targets not available for Boost version 106200
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
  cmake/Dependencies.cmake:5 (find_package)
  CMakeLists.txt:43 (include)


CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
  Imported targets not available for Boost version 106200
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
  cmake/Dependencies.cmake:5 (find_package)
  CMakeLists.txt:43 (include)


CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
  Imported targets not available for Boost version 106200
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
  cmake/Dependencies.cmake:5 (find_package)
  CMakeLists.txt:43 (include)


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
-- Found GFlags: /usr/local/include  
-- Found gflags  (include: /usr/local/include, library: /usr/local/lib/libgflags.a)
-- Found Glog: /usr/local/include  
-- Found glog    (include: /usr/local/include, library: /usr/local/lib/libglog.so)
-- Found Protobuf: /usr/local/lib/libprotobuf.so  
-- Found PROTOBUF Compiler: /usr/local/bin/protoc
-- Found HDF5: /usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5_hl.so;/usr/lib/x86_64-linux-gnu/hdf5/serial/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/usr/lib/x86_64-linux-gnu/libsz.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.8.16") 
-- Found LMDB: /usr/local/include  
-- Found lmdb    (include: /usr/local/include, library: /usr/local/lib/liblmdb.so)
-- Found LevelDB: /usr/include  
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)
-- Found Snappy: /usr/include  
-- Found Snappy  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)
-- CUDA detected: 8.0
-- Found cuDNN: ver. 5.1.5 found (include: /usr/local/cuda/include, library: /usr/local/cuda/lib64/libcudnn.so)
-- Added CUDA NVCC flags for: sm_30
-- OpenCV found (/usr/local/share/OpenCV)
-- Found Atlas: /usr/include  
-- Found Atlas (include: /usr/include, library: /usr/lib/libatlas.so)
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.12", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.12", minimum required is "2.7") 
-- Found NumPy: /usr/local/lib/python2.7/dist-packages/numpy/core/include (found suitable version "1.11.2", minimum required is "1.7.1") 
-- NumPy ver. 1.11.2 found (include: /usr/local/lib/python2.7/dist-packages/numpy/core/include)
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):
  Imported targets not available for Boost version 106200
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)
  cmake/Dependencies.cmake:147 (find_package)
  CMakeLists.txt:43 (include)


-- Boost version: 1.62.0
-- Found the following Boost libraries:
--   python
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- Found Git: /usr/bin/git (found version "2.7.4") 
-- 
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0-rc3
--   Git               :   rc3-303-g5a201dd-dirty
--   System            :   Linux
--   C++ compiler      :   /usr/bin/c++
--   Release CXX flags :   -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Debug CXX flags   :   -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized
--   Build type        :   Release
-- 
--   BUILD_SHARED_LIBS :   ON
--   BUILD_python      :   ON
--   BUILD_matlab      :   OFF
--   BUILD_docs        :   ON
--   CPU_ONLY          :   OFF
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   ALLOW_LMDB_NOLOCK :   OFF
-- 
-- Dependencies:
--   BLAS              :   Yes (Atlas)
--   Boost             :   Yes (ver. 1.62)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.1.0)
--   lmdb              :   Yes (ver. 0.9.70)
--   LevelDB           :   Yes (ver. 1.18)
--   Snappy            :   Yes (ver. 1.1.3)
--   OpenCV            :   Yes (ver. 3.1.0)
--   CUDA              :   Yes (ver. 8.0)
-- 
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_30
--   cuDNN             :   Yes (ver. 5.1.5)
-- 
-- Python:
--   Interpreter       :   /usr/bin/python2.7 (ver. 2.7.12)
--   Libraries         :   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12)
--   NumPy             :   /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.11.2)
-- 
-- Documentaion:
--   Doxygen           :   No
--   config_file       :   
-- 
-- Install:
--   Install path      :   /home/denis/code/caffe/build/install
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/denis/code/caffe/build

В разделе Integration with Caffe в в этом руководстве по установке OpenCV 3.1 для Ubuntu 16.04 сказано, что я должен включить /usr/local/share/OpenCV/3rdparty/lib/ в свою переменную LIBRARY_DIRS в Makefile.config. Однако у меня нет 3rdparty/lib/ в папке /usr/local/share/OpenCV.

(deep-learning) ➜  caffe git:(master) ✗ ls /usr/local/share/OpenCV
haarcascades  lbpcascades  OpenCVConfig.cmake  OpenCVConfig-version.cmake  OpenCVModules.cmake  OpenCVModules-release.cmake

Я внес все изменения в Makefile и Makefile.config, указанные в большинстве руководств по установке Caffe.

В моем Makefile.config у меня есть это (вот полный файл):

USE_CUDNN := 1
OPENCV_VERSION := 3
CUDA_DIR := /usr/local/cuda-8.0
WITH_PYTHON_LAYER := 1

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial /usr/local/share/OpenCV/3rdparty/lib/
USE_PKG_CONFIG := 1

А вот часть контента из Makefile (полный файл):

LIBRARIES += glog gflags protobuf leveldb snappy \
  lmdb boost_system hdf5_hl hdf5 m \
  opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs opencv_videoio

NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)

Я даже не уверен, что это может быть и почему происходит ошибка. Одна из теорий состоит в том, что это конфликт версий OpenCV или что-то (возможно, я установил OpenCV 2 раньше, но я не думаю, что он у меня есть сейчас, и cv.__version__ в python дает мне 3.1.0). Другие люди говорят, что это какая-то проблема со связью, хотя я не понимаю, как решить такие проблемы.


Не могли бы вы помочь мне решить мою проблему и нормально установить Caffe?


PS: я уже столько времени потратил, пытаясь установить Caffe с OpenCV 3.1, что думаю, что буду счастлив даже с OpenCV 2 (если только он работает), но я не уверен, что смогу полностью удалить OpenCV 3.1 из моего system, потому что с OpenCV 3.1 связано множество разных файлов в куче разных папок.


person Denis Yakovenko    schedule 11.12.2016    source источник
comment
Для меня это не похоже на ошибку OpenCV! Вы правильно установили библиотеки boost? Это серьезно похоже на проблему с библиотекой Boost!   -  person Anoop K. Prabhu    schedule 12.12.2016
comment
@ AnoopK.Prabhu да, я собрал Boost 1.62 из исходников. И, более того, скрипт cmake идентифицирует его правильно. Любые идеи о том, как это решить?   -  person Denis Yakovenko    schedule 12.12.2016
comment
Если все в порядке, попробуйте установить библиотеку boost с помощью apt-get и посмотрите, решит ли это проблему.   -  person Anoop K. Prabhu    schedule 12.12.2016
comment
@ AnoopK.Prabhu Должен ли я удалить свою версию 1.62 перед ее установкой с помощью apt-get?   -  person Denis Yakovenko    schedule 12.12.2016
comment
Чтобы быть в безопасности, да.   -  person Anoop K. Prabhu    schedule 12.12.2016
comment
@ AnoopK.Prabhu Итак, я удалил свою версию 1.62 и установил Boost, используя sudo apt-get install libboost-all-dev (версия 1.58), и получаю ту же ошибку. Может быть, я могу сделать что-то еще? Я действительно не могу понять, почему это должно быть так много боли при установке всего этого .. (   -  person Denis Yakovenko    schedule 12.12.2016
comment
Чтобы поймать одну птицу за раз, было бы лучше, если бы вы могли закомментировать пути включения python и пути к библиотеке python и сделать make, чтобы кофе работал без python. Я сталкивался с проблемами, когда в анаконде тоже присутствовало много библиотек, но с разными номерами версий.   -  person Anoop K. Prabhu    schedule 12.12.2016
comment
@ AnoopK.Prabhu Итак, я закомментировал строки PYTHON_LIB и PYTHON_INCLUDE в моем Makefile.config, и теперь я получаю сообщение об ошибке при запуске sudo make all. Вот ошибка: pastebin.com/CALyvATC   -  person Denis Yakovenko    schedule 12.12.2016


Ответы (1)


Итак, ниже приведены шаги, которые я предпринял для решения моей проблемы:

  1. Удалите все файлы, связанные с OpenCV
  2. Удалите все файлы, связанные с Boost
  3. Удалите все файлы, связанные с Caffe
  4. Установите Boost, используя sudo apt-get install libboost-all-dev
  5. Установите OpenCV 3.1
  6. Отключить виртуальную среду
  7. Исключите Anaconda2 из пути и используйте стандартный дистрибутив Python
  8. Следуйте официальному руководству и продолжайте использовать стандартный дистрибутив Python.

По сути, я просто отказался от использования Anaconda, и он начал работать нормально.

person Denis Yakovenko    schedule 12.12.2016