Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install caffe on ubuntu 18.04 LTS

Tags:

I'm installing caffe-cpu and anaconda on Ubuntu 18.04 LTS version.

Anyway, I success to install Anaconda on my system, but I'm getting in trouble to install caffe.

I found many pages such as youtube, but it isn't helpful, so i read many times to official installation manual page (I think here is the official page). In this page,

Installing Caffe from source

We may install the dependencies by merely one line
sudo apt build-dep caffe-cpu        # dependencies for CPU-only version
sudo apt build-dep caffe-cuda       # dependencies for CUDA version

It requires a deb-src line in your sources.list. Continue with compliation

I can't know end line means. I tried to fix /etc/apt/sources.list as disabled
'#' part, but it's fail. I can't find the correct way on the internet. when I just follow the compliation link, they say compliation with Make or CMake. I also don't know how to follow these information. I found some makefile.config Github page, it fails when I use make all command.

Could you give me some advice to help install caffe-cpu version? Thanks for read my question.

like image 807
Yang Avatar asked Jan 06 '19 14:01

Yang


1 Answers

I was able to get it working following these steps,

  1. Get caffe source form here (https://github.com/BVLC/caffe.git)

  2. Install CUDA if you need GPS support (https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804)

  3. Install CUDNN, if you need GPS support (https://developer.nvidia.com/rdp/cudnn-download)

  4. Replace existing Makefile.config with this (https://gist.github.com/GPrathap/1f9d184c55779509860b8bf92cea416d) Here I have configured for cuda 9.2. If you have a different version please search 9.2 and change the version which you have instaled. Also, please recheck all the paths which are declared in Makefile.config.

  5. You may type make all followed by make test

  6. make distribute for creating the final lib, an include directory of caffe which can be found in (caffe/distribute).

  7. If you are using CMake type project add where to find caffe as bellow,

      set(Caffe_DIR "/home/software/caffe/distribute")   
      set(Caffe_INCLUDE_DIRS "/home/software/caffe/distribute/include")  
      set(Caffe_LIBRARIES "/home/software/caffe/distribute/lib/libcaffe.so")
    
  8. Add include directory include_directories(${Caffe_INCLUDE_DIRS})

  9. Add library ${Caffe_LIBRARIES}

  10. If you want to have another way of building it add PATH appropriately

like image 172
GPrathap Avatar answered Nov 06 '22 21:11

GPrathap