Skip to content

Instantly share code, notes, and snippets.

@fortunto2
Last active August 10, 2016 19:04
Show Gist options
  • Save fortunto2/8ce409fd71c9f9cd87ff491287135b0d to your computer and use it in GitHub Desktop.
Save fortunto2/8ce409fd71c9f9cd87ff491287135b0d to your computer and use it in GitHub Desktop.
opencv caffe anaconda ubuntu 16 (decktop cpu)

Anaconda python

https://www.continuum.io/downloads#_unix

OpenCV

opencv 2

conda install -c https://conda.binstar.org/menpo opencv

opencv3

conda install -c https://conda.binstar.org/menpo opencv3

caffe

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev

sudo apt-get install libatlas-base-dev

sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

ccmake ..

 ALLOW_LMDB_NOLOCK                OFF                                                                                                 
 BLAS                             Atlas                                                                                               
 BOOST_THREAD_LIBRARY             /usr/lib/x86_64-linux-gnu/libpthread.so                                                             
 BUILD_SHARED_LIBS                ON                                                                                                  
 BUILD_docs                       ON                                                                                                  
 BUILD_matlab                     OFF                                                                                                 
 BUILD_only_tests                                                                                                                     
 BUILD_python                     ON                                                                                                  
 BUILD_python_layer               ON                                                                                                  
 CAFFE_TARGET_SOVERSION           1.0.0-rc3                                                                                           
 CAFFE_TARGET_VERSION             1.0.0-rc3                                                                                           
 CMAKE_BUILD_TYPE                                                                                                                     
 CMAKE_INSTALL_PREFIX             /home/rustam/caffe/install                                                                          
 CMAKE_INSTALL_RPATH_USE_LINK_P   TRUE                                                                                                
 CPU_ONLY                         ON                                                                                                  
 CUDA_HOST_COMPILER               /usr/bin/cc                                                                                         
 CUDA_SDK_ROOT_DIR                CUDA_SDK_ROOT_DIR-NOTFOUND                                                                          
 CUDA_TOOLKIT_ROOT_DIR            CUDA_TOOLKIT_ROOT_DIR-NOTFOUND                                                                      
 CUDA_USE_STATIC_CUDA_RUNTIME     OFF                                                                                                 
 HDF5_DIR                         HDF5_DIR-NOTFOUND                                                                                   
 OpenCV_DIR                       /usr/local/share/OpenCV                                                                             
 USE_LEVELDB                      ON                                                                                                  
 USE_LMDB                         ON                                                                                                  
 USE_OPENCV                       ON                                                                                                  
 USE_PROJECT_FOLDERS              OFF                                                                                                 
 python_version                   2  
make all
make test
make runtest

make pycaffe - compile the Python wrappers

make distribute - create a distribute directory with all the Caffe headers, compiled libraries, binaries

Also, in Ubuntu, the python wrapper can be added into the PYTHONPATH in the file ".bashrc" at /home .

export PYTHONPATH=/home/username/caffe/python

for caffe

conda install pydot
conda install graphviz

#short link
sudo ln -s /home/rustam/caffe/install/bin/caffe /usr/local/bin/caffe

start tutorial for caffe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment