- Install a clean Ubuntu 16.04 and mkdir workspace
- sudo apt install git and git clone https://github.com/BVLC/caffe
- sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
- sudo apt-get install libatlas-base-dev
- sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
- Go to python folder inside the caffe directory: cd python/
- Install pip: sudo apt install python-pip
- Upgrade pip: sudo -H pip install --upgrade pip
- Install all the dependency in requirements.txt via:
- for req in 'cat requirements.txt'; do pip install $req; done
- sudo pip install -r requirements.txt
- sudo apt-get install python-dev
- sudo apt-get install -y python-numpy python-scipy
- sudo apt-get install --no-install-recommends libboost-all-dev
- Go to caffe folder and cp Makefile.config.example Makefile.config.
- Edit Makefile.config:
- 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 /usr/lib/x86_64-linux-gnu/hdf5/serial
- Uncomment: CPU_ONLY := 1 if this is CPU only mode
- Now make!
- make pycaffe
- make all
- make test
- make runtest
- make distribute
- export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH
- Verify by running python2.7:
- >>> import caffe
- >>> caffe._version__
- Install opencv:
- sudo apt-get install python-opencv
- sudo pip install opencv-python
- Install lmdb: sudo pip install lmdb
You should be able to see All Pass. Happy Ending.
http://blog.csdn.net/qq_25737169/article/details/77773884
No comments:
Post a Comment