Skip to content

Instantly share code, notes, and snippets.

@jeremyfix
Created July 2, 2019 15:33
Show Gist options
  • Save jeremyfix/9c78c9ad88fab62acb245e91b821699f to your computer and use it in GitHub Desktop.
Save jeremyfix/9c78c9ad88fab62acb245e91b821699f to your computer and use it in GitHub Desktop.
deep-visualization-toolbox on ubuntu 18.04
############################# Compilation of caffe
git clone https://github.com/BVLC/caffe.git
cd caffe
git remote add yosinski https://github.com/yosinski/caffe.git
git fetch --all
git checkout --track -b deconv-deep-vis-toolbox yosinski/deconv-deep-vis-toolbox
sudo apt install libgflags-dev libgoogle-glog-dev libhdf5-dev libleveldb-dev liblmdb-dev libsnappy-dev libatlas3-base libatlas-base-dev
python -m pip install protobuf --user # Required by pycaffe
cp Makefile.config.example Makefile.config
vim Makefile.config # Modify the file as requested (for CPU only , uncomment the appropriate line)
### MODIFICATIONS of Makefile.config
# Uncomment
CPU_ONLY := 1
# Replace INCLUDE_DIRS and LIBRARY_DIRS by
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/
# Uncomment
USE_PKG_CONFIG := 1
####
make clean
make -j6 # Adjust this as needed ... otherwise, it takes all the CPU ..
make pycaffe
################# Deep visualization
cd ..
git clone https://github.com/yosinski/deep-visualization-toolbox
cd deep-visualization-toolbox
cp models/caffenet-yos/settings_local.template-caffenet-yos.py settings_local.py
# Modify, in settings_local.py, the following line so that it points to the caffe directory
caffevis_caffe_root = '/path/to/caffe'
caffevis_mode_gpu = False # Required if CPU only
cd models/caffenet-yos/
./fetch.sh
cd ../..
# If you use CPU only, edit settings_local.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment