caffe实现3D卷积代码 C3D 安装遇到的问题记录

caffe实现3D卷积代码 C3D 安装遇到的问题记录

C3D项目:http://vlg.cs.dartmouth.edu/c3d/
C3D主要用于提取视频特征,能够进行3D卷积,作者认为3D卷积相比起2D卷积能够更好地从时域货图像通道中提取信息。C3D不认protobuf3.1.0,我重装的3.0.0版本。

caffe小白,从零开始,因为需要使用这个3D卷积所以开始自己安装caffe的痛苦旅程,说实话基本没有搜到中文版的C3D安装,也可能是大家都比较顺利吧,我这种bug体质,基本上所有问题要遇个遍,也算留个记录。

从caffe编译开始,显卡是GTX980Ti 不支持pascal,cuda7.5,Python2.7,

问题1
首先修改makefile.config,具体怎么改网上到处是随便找找就行,个人感觉特别要注意的是cuda的版本,我的显卡不支持pascal所以60 61都要注释掉,否则会报错。

# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
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 \
        -gencode arch=compute_52,code=sm_52 \
#       -gencode arch=compute_60,code=sm_60 \
#       -gencode arch=compute_61,code=sm_61 \
#       -gencode arch=compute_61,code=compute_61

问题2
找不到libpng16.so.16文件。解决办法我在这里找的,
http://stackoverflow.com/questions/31962975/caffe-install-on-ubuntu-for-anaconda-with-python-2-7-fails-with-libpng16-so-16-n
直接在makefile.config中添加了

LINKFLAGS := -Wl,-rpath,$(ANACONDA_HOME)/lib

然后就是血泪教训了!一定注意!这个不能随便加!多加一行!bug改3天!
这行只要出现在makefile.config里面,会导致anaconda的lib和系统原来的lib冲突,然后报错,这时候添加一万遍$LD_LIBRARY_PATH都不好使,万年都是下面的错误。
libunwind.so.8: undefined reference
//usr/lib/x86_64-linux-gnu/libunwind.so.8
正确的方法是修改.bashrc文件,添加

export LD_LIBRARY_PATH=/home/mitc/anaconda2/lib:$LD_LIBRARY_PATH

然后source一下就可以了。

问题3:
报错:
libunwind.so.8: undefined reference
//usr/lib/x86_64-linux-gnu/libunwind.so.8

解决方法:
正确的方法是修改.bashrc文件,添加

export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

保险起见我觉得这个新添加的路径应该在anaconda前面,然后source一下就可以了。

猜你喜欢

转载自blog.csdn.net/elysion122/article/details/64151247
今日推荐