close

 

Installing

 

sudo apt-get update
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

cd Downloads
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb

sudo apt-get upgrade -y
sudo apt-get install -y opencl-headers build-essential protobuf-compiler \
    libprotoc-dev libboost-all-dev libleveldb-dev hdf5-tools libhdf5-serial-dev \
    libopencv-core-dev  libopencv-highgui-dev libsnappy-dev libsnappy1 \
    libatlas-base-dev cmake libstdc++6-4.8-dbg libgoogle-glog0 libgoogle-glog-dev \
    libgflags-dev liblmdb-dev git python-pip gfortran
sudo apt-get clean
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r`
sudo apt-get clean

cd
git clone https://github.com/BVLC/caffe.git
cd caffe
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
cp Makefile.config.example Makefile.config

sed -i '/^# CPU_ONLY := 1/s/^# //' Makefile.config
sed -i '/^# WITH_PYTHON_LAYER := 1/s/^# //' Makefile.config
sed -i '/^PYTHON_INCLUDE/a    /usr/local/lib/python2.7/dist-packages/numpy/core/include/ \\' Makefile.config

 

 

 

make all -j8

 

 

 


make test -j8

 

 

 


make runtest

 

 

 

cd ~/Downloads
wget http://repo.continuum.io/archive/Anaconda2-4.0.0-Linux-x86_64.sh
bash ./Anaconda2-4.0.0-Linux-x86_64.sh
export PATH=~/anaconda2/bin:$PATH

sudo apt-get install graphviz
sudo apt-get install python-opencv
conda install opencv

pip install --upgrade pip
pip install lmdb
pip install pydot

cd ~/caffe/python
for req in $(cat requirements.txt); do pip install $req; done
cd ~/caffe
make pycaffe

echo 'export CAFFE_ROOT=/home/user/caffe' >> ~/.bashrc
echo 'export PYTHONPATH=/home/user/caffe/python:/home/user/anaconda2/bin/python' >> ~/.bashrc
source ~/.bashrc

sudo ln /dev/null /dev/raw1394

 

 

 


 

Example

 

cd ~/caffe

(download model to models/bvlc_reference_caffenet/)  http://dl.caffe.berkeleyvision.org/bvlc_reference_caffenet.caffemodel
sudo ./scripts/download_model_binary.py models/bvlc_reference_caffenet

sudo sh ./data/ilsvrc12/get_ilsvrc_aux.sh

 

 

sudo ./build/examples/cpp_classification/classification.bin \
  models/bvlc_reference_caffenet/deploy.prototxt \
  models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel \
  data/ilsvrc12/imagenet_mean.binaryproto \
  data/ilsvrc12/synset_words.txt \
  examples/images/cat.jpg

 

 

arrow
arrow

    scud 發表在 痞客邦 留言(0) 人氣()