Ubuntu 16.04コンパイルCaffeが踏んだ穴


問題1
make allプロシージャが表示されます
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/data_transformer.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/data_transformer.hpp:6,
                 from src/caffe/data_transformer.cpp:8:
./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING’ not handled in switch [-Wswitch]
   switch (status) {
          ^
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::setConvolutionDesc(cudnnConvolutionStruct**, cudnnTensorDescriptor_t, cudnnFilterDescriptor_t, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:113:70: error: too few arguments to function ‘cudnnStatus_t cudnnSetConvolution2dDescriptor(cudnnConvolutionDescriptor_t, int, int, int, int, int, int, cudnnConvolutionMode_t, cudnnDataType_t)’
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
                                                                      ^
./include/caffe/util/cudnn.hpp:15:28: note: in definition of macro ‘CUDNN_CHECK’
     cudnnStatus_t status = condition; \
                            ^
In file included from ./include/caffe/util/cudnn.hpp:5:0,
                 from ./include/caffe/util/device_alternate.hpp:40,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/data_transformer.hpp:6,
                 from src/caffe/data_transformer.cpp:8:
/usr/local/cuda/include/cudnn.h:500:27: note: declared here
 cudnnStatus_t CUDNNWINAPI cudnnSetConvolution2dDescriptor( cudnnConvolutionDescriptor_t convDesc,
                           ^
Makefile:575: recipe for target '.build_release/src/caffe/data_transformer.o' failed
make: *** [.build_release/src/caffe/data_transformer.o] Error 1

cudnn.h:500:27: note: declared here  cudnnStatus_t CUDNNWINAPI cudnnSetConvolution2dDescriptor( cudnnConvolutionDescriptor_t convDesc,                            ^
Googleはcudnnであることを発見した.h cudnnv 5に互換性がないという問題は、
解決策は新しいバージョンcaffeのcudnnである.hppは、現在のcaffeルートディレクトリの下にあるinclude/caffe/util/のcudnnを置き換える.hpp
問題2
CXX/LD -o .build_release/tools/extract_features.bin//home/sgx/software/anaconda2/lib/libpng16.so.16:対'inflateValidate@ZLIB_1.2.9'未定義の参照collect 2:error:ld returned 1 exit status Makefile:619:recipe for target'.build_release/tools/upgrade_solver_proto_text.bin' failed make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1
解決策---Makefile.configには、以下のコードLINKFLAGS:=-Wl,-rpath,$(HOME)/anaconda 3/libを追加します.
この方法では、ZLIBを更新することはできませんが、現在は1.2.8バージョンの検索ソースインストール1.2.11バージョンです.
問題3
LD -o .build_release/lib/libcaffe.so.1.0.0-rc 3/usr/bin/ld:見つからない-lhdf 5_hl/usr/bin/ld:見つからない-lhdf 5
解決策cd/usr/lib/x 86_64-linux-gnu
sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so