I am trying to install caffe, but ran into the following error
sudo apt-get install caffe-cpu
[sudo] password for :
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package caffe-cpu
This is my version:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
I tried following the instructions here https://chunml.github.io/ChunML.github.io/project/Installing-Caffe-CPU-Only/
Got
CXX src/caffe/test/test_hdf5_output_layer.cpp
In file included from src/caffe/test/test_hdf5_output_layer.cpp:8:0:
./include/caffe/layers/hdf5_output_layer.hpp:4:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
Makefile:581: recipe for target '.build_release/src/caffe/test/test_hdf5_output_layer.o' failed
make: *** [.build_release/src/caffe/test/test_hdf5_output_layer.o] Error 1
This is what I have
ThinkPad-T520:/usr/lib/x86_64-linux-gnu$ ls -al | grep libhdf5_serial
lrwxrwxrwx 1 root root 53 Jul 19 10:03 libhdf5_hl.so -> /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10.0.2
-rw-r--r-- 1 root root 19953086 Apr 5 2016 libhdf5_serial.a
-rw-r--r-- 1 root root 1659560 Apr 5 2016 libhdf5_serial_fortran.a
lrwxrwxrwx 1 root root 32 Apr 5 2016 libhdf5_serial_fortran.so -> libhdf5_serial_fortran.so.10.0.2
lrwxrwxrwx 1 root root 32 Apr 5 2016 libhdf5_serial_fortran.so.10 -> libhdf5_serial_fortran.so.10.0.2
-rw-r--r-- 1 root root 238408 Apr 5 2016 libhdf5_serial_fortran.so.10.0.2
-rw-r--r-- 1 root root 878832 Apr 5 2016 libhdf5_serial_hl.a
-rw-r--r-- 1 root root 515320 Apr 5 2016 libhdf5_serialhl_fortran.a
lrwxrwxrwx 1 root root 34 Apr 5 2016 libhdf5_serialhl_fortran.so -> libhdf5_serialhl_fortran.so.10.0.2
lrwxrwxrwx 1 root root 34 Apr 5 2016 libhdf5_serialhl_fortran.so.10 -> libhdf5_serialhl_fortran.so.10.0.2
-rw-r--r-- 1 root root 80520 Apr 5 2016 libhdf5_serialhl_fortran.so.10.0.2
lrwxrwxrwx 1 root root 27 Apr 5 2016 libhdf5_serial_hl.so -> libhdf5_serial_hl.so.10.0.2
lrwxrwxrwx 1 root root 27 Apr 5 2016 libhdf5_serial_hl.so.10 -> libhdf5_serial_hl.so.10.0.2
-rw-r--r-- 1 root root 126232 Apr 5 2016 libhdf5_serial_hl.so.10.0.2
-rw-r--r-- 1 root root 3859 Apr 5 2016 libhdf5_serial.settings
lrwxrwxrwx 1 root root 24 Apr 5 2016 libhdf5_serial.so -> libhdf5_serial.so.10.1.0
lrwxrwxrwx 1 root root 24 Apr 5 2016 libhdf5_serial.so.10 -> libhdf5_serial.so.10.1.0
-rw-r--r-- 1 root root 2734288 Apr 5 2016 libhdf5_serial.so.10.1.0
lrwxrwxrwx 1 root root 50 Jul 19 10:03 libhdf5.so -> /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10.1.0
After making changes to Makefine.config, getting
CXX src/caffe/util/hdf5.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/layer_factory.cpp
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: cannot find -lopencv_imgcodecs
/usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
Makefile:572: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
caffe-cpu is in the default Ubuntu repositories in Ubuntu 18.04 and later. Upgrade to Ubuntu 18.04 and you can install caffe-cpu with the following command:
Results of
apt-cache showpkg caffe-cpu
in Ubuntu 18.04:I found the best way to get up and running is to use conda. This way allows you to have many different caffe environments. First install miniconda, then make an environment
then
OR
Not only does conda solve all the dependencies but it also installs the correct version of cudatoolkit and cudnn. And if you want python 2 you can
The variable, py27heda4471_3, is the build version and you have many to choose from
gives a list