Caffe 安装和使用。
安装
OSX 系统
配置环境:
1 | sudo mkdir ~/caffe_python |
CentOS 系统
1 | sudo yum install -y protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel |
Ubuntu 系统
1 | sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler |
配置环境
1 | #编辑 rc.local 文件,添加 |
测试运行时间
1 | cd $CAFFE_ROOT |
报错
问题1
1 | Fatal error: hdf5.h: 没有那个文件或目录 |
解决:
1 | Makefile.config 中: |
问题2
1 | .build_release/lib/libcaffe.so:对‘boost::re_detail_106200::get_default_error_string(boost::regex_constants::error_type)’未定义的引用 |
解决:
1 | 在 Makefile 中添加: |
问题3
1 | Undefined symbols for architecture x86_64: |
解决:
1 | Makefile.config中: |
问题4
1 | src/caffe/test/test_proposal_layer.cpp:28:26: error: no template named 'GPUDevice'; did you mean 'CPUDevice'? |
解决:
1 | 删除该文件 |
问题5
1 | cannot find -lboost_python3 |
解决:
1 | cd /usr/lib/x86_64-linux-gnu |
问题6
1 | By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has |
解决:
1 | export OpenCV_DIR=/usr/local/Cellar/opencv@2/2.4.13.2_2/share/OpenCV |
问题7
1 | libdc1394 error: Failed to initialize libdc1394 |
解决:
1 | sudo ln /dev/null /dev/raw1394 |
问题8
1 | vec.lib not found4 |
解决:
1 | #修改 CMakeCache.txt |
问题9
1 | ld: library not found for -lboost_thread-my |
解决:
1 | #编辑 Makefile 文件 |