Ubuntu titanx CUDA8.0+cudnn5.1+Caffe 安装与遇到的报错
2017-07-12 19:35
375 查看
一、CUDA8.0+CUDNN.5.1
http://www.2cto.com/kf/201610/552429.html
二、anaconda安装
http://www.linuxidc.com/Linux/2016-07/132860.htm
三、参考 (CPU)http://blog.csdn.net/qq_36620489/article/details/73658151
`GLIBCXX_3.4.20' not found
修复:
conda
install
libgcc
ImportError: No module named google.protobuf.internal
修复:
方法: 安装protobuf最新版本
查看:
sudo protoc --version libprotoc 2.6.1
protoc --version libprotoc 2.6.1
命令: ~/anaconda2/bin$
pip install protobuf
2、fatal error: caffe/proto/caffe.pb.h:
bf88
No suchfileordirectory
#include "caffe/proto/caffe.pb.h"
修复:
1)用protoc从caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc
mark@mark-Default-string-Invalid-entry-length-16-Fixed-up-to-11:~/caffe/src/caffe/proto$ protoc --cpp_out=/home/mark/caffe/include/caffe/ caffe.proto
2)) 在caffe/include/caffe目录下新建文件夹,命名为proto,然后把编译出来的caffe.pb.h和caffe.pb.cc放进去,之后,错误消失。
3、Check failed: error == cudaSuccess (8 vs. 0) invalid device function
该错误是由于GPU的运算能力的不匹配所导致的,在makefile。config里改
# CUDA architecture setting: going with all of them.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50
1.make all -j16 编译时候出现
make: * [.build_release/examples/siamese/convert_mnist_siamese_data.bin] Error 1
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFReadDirectory@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFWriteEncodedStrip@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFIsTiled@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFOpen@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFSetField@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFWriteScanline@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFGetField@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFScanlineSize@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFNumberOfStrips@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFSetErrorHandler@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFReadRGBATile@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFClose@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFRGBAImageOK@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0’
collect2: error: ld returned 1 exit status
解决方案:
sudo make all -j16;
sudo make test -j16
2、sudo make runtest
.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.10: cannot open shared object file: No such file or directory
Makefile:532: recipe for target 'runtest' failed
make: *** [runtest] Error 127
解决方案:
将 anaconda lib 的路径添加到环境变量 LD_LIBRARY_PATH中,具体命令为:
1). export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{anaconda_dir}/lib
2). source ~/.bashrc
3、
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:566: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
解决方案:
将 makefile 的
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
改成:
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
sudo make all -j16
sudo make test -j16
会出现警告(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).)
make runtest
运行结果:成功!
sudo make pycaffe
添加 $ sudo gedit ~/.bashrc
export PYTHONPATH=”/home/name/caffe/python:$PYTHONPATH”
之后编译链接库,打开ipython/python,输入:
即可调用caffe相应模块了。matlab模块可以直接测试caffe/matlab/+caffe的用例。
http://www.2cto.com/kf/201610/552429.html
二、anaconda安装
http://www.linuxidc.com/Linux/2016-07/132860.htm
三、参考 (CPU)http://blog.csdn.net/qq_36620489/article/details/73658151
问题汇总:
1、anaconda2/bin/../lib/libstdc++.so.6: version`GLIBCXX_3.4.20' not found
修复:
conda
install
libgcc
ImportError: No module named google.protobuf.internal
修复:
方法: 安装protobuf最新版本
查看:
sudo protoc --version libprotoc 2.6.1
protoc --version libprotoc 2.6.1
命令: ~/anaconda2/bin$
pip install protobuf
2、fatal error: caffe/proto/caffe.pb.h:
bf88
No suchfileordirectory
#include "caffe/proto/caffe.pb.h"
修复:
1)用protoc从caffe/src/caffe/proto/caffe.proto生成caffe.pb.h和caffe.pb.cc
mark@mark-Default-string-Invalid-entry-length-16-Fixed-up-to-11:~/caffe/src/caffe/proto$ protoc --cpp_out=/home/mark/caffe/include/caffe/ caffe.proto
2)) 在caffe/include/caffe目录下新建文件夹,命名为proto,然后把编译出来的caffe.pb.h和caffe.pb.cc放进去,之后,错误消失。
3、Check failed: error == cudaSuccess (8 vs. 0) invalid device function
该错误是由于GPU的运算能力的不匹配所导致的,在makefile。config里改
# CUDA architecture setting: going with all of them.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50
1.make all -j16 编译时候出现
make: * [.build_release/examples/siamese/convert_mnist_siamese_data.bin] Error 1
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFReadDirectory@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFWriteEncodedStrip@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFIsTiled@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFOpen@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFReadEncodedStrip@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFSetField@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFWriteScanline@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFGetField@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFScanlineSize@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFNumberOfStrips@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFSetErrorHandler@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFReadRGBATile@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to TIFFClose@LIBTIFF_4.0'
/usr/local/lib/libopencv_imgcodecs.so: undefined reference toTIFFRGBAImageOK@LIBTIFF_4.0’
/usr/local/lib/libopencv_imgcodecs.so: undefined reference to `TIFFReadRGBAStrip@LIBTIFF_4.0’
collect2: error: ld returned 1 exit status
解决方案:
sudo make all -j16;
sudo make test -j16
2、sudo make runtest
.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.10: cannot open shared object file: No such file or directory
Makefile:532: recipe for target 'runtest' failed
make: *** [runtest] Error 127
解决方案:
将 anaconda lib 的路径添加到环境变量 LD_LIBRARY_PATH中,具体命令为:
1). export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{anaconda_dir}/lib
2). source ~/.bashrc
3、
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:566: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1
解决方案:
将 makefile 的
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5 opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
改成:
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
sudo make all -j16
sudo make test -j16
会出现警告(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).)
make runtest
运行结果:成功!
sudo make pycaffe
添加 $ sudo gedit ~/.bashrc
export PYTHONPATH=”/home/name/caffe/python:$PYTHONPATH”
之后编译链接库,打开ipython/python,输入:
$ import caffe
即可调用caffe相应模块了。matlab模块可以直接测试caffe/matlab/+caffe的用例。
相关文章推荐
- ubuntu16.04+cuda8.0+cudnn5.1+caffe------caffe安装与编译
- Ubuntu14.04 cuda8.0 opencv3.0安装caffe及遇到的各种报错的解决办法
- ubuntu16.04+cuda8.0+cudnn5.1+caffe 安装(基于独立主机&集成显卡>X1080Ti)
- ubuntu14.04+cuda8.0+cudnn5.1+caffe+tensorflow 安装教程(三)
- ubuntu16.04+cuda8.0+cudnn5.1+caffe 安装(基于独立主机&集成显卡&GTX1080Ti)
- ubuntu14.04+cuda8.0+cudnn5.1+caffe+tensorflow 安装教程(一)
- ubuntu16.04+cuda8.0+cudnn5.1+caffe------Opencv3.1.0安装
- Ubuntu1504-cuda8.0-caffe安装教程(Titan X Pascal)
- 小白玩Caffe——基于Ubuntu14.04+CUDA8.0+cudnn5.1的Caffe安装与MNIST实验
- 心酸的Caffe安装之路 环境搭配 Ubuntu16.04+gtx1080+cuda8.0+cudnn5.1+opencv+Anaconda3+caffe
- ubuntu 16.04 cuda 8.0 caffe 安装 及遇到的问题。
- 华硕B250主板安装Ubuntu16.04+gtx1050Ti显卡驱动+cuda8.0+cudnn5.1+opencv3.1+caffe+tensorflow
- 配有Tesla K40c的服务器新装Ubuntu16.04并安装CUDA8.0、Anaconda3、Matlab2016a、OPENCV3.1、CuDNN5.1、MXNet
- 超详细 Ubuntu / Ubuntu Kylin 16.04 + OpenCV 2.4 + CUDA 8.0 + cuDNN 5.0 + Caffe_SSD 安装教程
- Ubuntu16.04+cuda8.0+opencv3.1+caffe+anaconda安装,双显卡
- Caffe深度学习框架安装(Ubuntu14.04+cuda8.0)
- CUDA8.0+Ubuntu14.04+Caffe安装过程之CUDA安装教程
- Ubuntu16.04+CUDA8.0+cudnn7.5+Caffe安装过程
- Caffe + Ubuntu 15.04/16.04 + CUDA 7.5/8.0 在服务器上安装配置及卸载重新安装(已测试可执行)
- ubuntu16.04+gtx1060+cuda8.0+caffe安装、测试经历