1. Update the source list of APT
sudo add-apt-repository universe sudo add-apt-repository multiverse sudo apt-get update
2. Install CUDA-7.0 toolkit
sudo dpkg -i cuda-repo-l4t-r23.1-7-0-local_7.0-71_armhf.deb sudo apt-get update sudo apt-get install cuda-toolkit-7-0 export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib/
3. Install OpenCV for Tegra
sudo dpkg -i libopencv4tegra-repo_2.4.12.2_armhf.deb sudo apt-get update sudo apt-get install libopencv4tegra libopencv4tegra-dev
4. Install cnDNN
sudo tar xvf cudnn-7.0-linux-ARMv7-v4.0-prod.tgz sudo cp -a cuda/lib/libcudnn* /usr/local/cuda/lib/ sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
5. Setup Caffe environment
a) Install related packages sudo apt-get install libboost-all-dev libprotobuf-dev libleveldb-dev libsnappy-dev sudo apt-get install libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev sudo apt-get install liblmdb-dev libblas-dev libatlas-base-dev
b) Download Caffe source code Download caffe source package from https://github.com/BVLC/caffe/, click "download zip" to download caffe-master.zip, unzip the package in Jetson /home/ubuntu/Work/caffe/. sudo mkdir /home/ubuntu/Work sudo mkdir /home/ubuntu/Work/caffe sudo cp caffe-master.zip /home/ubuntu/Work/caffe/ sudo cd /home/ubuntu/Work/caffe/ sudo unzip caffe-master.zip
c) Compile Caffe source code cd /home/ubuntu/Work/caffe/caffe-master Edit the file Makefile.config.example and un-comment the following line, then CAFFE can use cuDNN acceleration. Save the file as Makefile.config. USE_CUDNN := 1 cp Makefile.config.example Makefile.config make -j4 When it's compiled successfully, build/lib/libcaffe.so will be generated.
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:caffe 编译 - Python技术站