Deep learning 错误:ld在安装过程中返回了1个退出状态

Deep learning 错误:ld在安装过程中返回了1个退出状态,deep-learning,caffe,Deep Learning,Caffe,我仍在进行Caffe安装,但现在我面临一个新问题。当我运行make命令时,会出现一个新的错误消息,即: LD -o .build_release/lib/libcaffe.so.1.0.0-rc3 /usr/bin/ld: cannot find -lhdf5_hl /usr/bin/ld: cannot find -lhdf5 /usr/bin/ld: cannot find -lopencv_imgcodecs collect2: error: ld returned 1 exit

我仍在进行Caffe安装,但现在我面临一个新问题。当我运行
make
命令时,会出现一个新的错误消息,即:

LD -o .build_release/lib/libcaffe.so.1.0.0-rc3

/usr/bin/ld: cannot find -lhdf5_hl

/usr/bin/ld: cannot find -lhdf5

/usr/bin/ld: cannot find -lopencv_imgcodecs

collect2: error: ld returned 1 exit status

Makefile:563: 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
我很确定我已经拥有了所有的依赖项。
希望有人能帮助我。谢谢。

您需要创建指向缺少的库文件的符号链接。对于
hdf5
,您可以执行以下操作:

ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10.0.1 /usr/lib/x86_64-linux-gnu/libhdf5.so
ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10.0.1 /usr/lib/x86_64-linux-gnu/libhdf5_hl.so

在创建符号链接之前,请检查库文件和操作系统的版本。对我来说是10.0.1,我的操作系统是Ubuntu 15.10。

它找不到访问文件的方法。我的意思是这里的文件是
libhdf5\u hl.so
libhdf5.so
libopencv\u imgcodecs.so

打开
Makefile.config
文件,您会发现以下几行:

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
这意味着我上面提到的3个文件在默认的
库\u DIRS
中找不到。搜索
usr
子目录。 如果您找到了位置,例如
/usr/local/hdf5/lib
,则将其添加到
库\u DIRS

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/hdf5/lib