安装 Protobuf
安装依赖库
sudo apt install -y autoconf automake libtool curl make g++ git python-dev python-setuptools unzip
下载 Protobuf 3.2
git clone https://github.com/google/protobuf ~/protobuf -b '3.2.x'
编译 Protobuf 3.2
cd ~/protobuf
sudo ./autogen.sh
sudo ./configure
sudo make -j6
sudo make install
sudo ldconfig
cd python
sudo python setup.py install --cpp_implementation
安装 NVIDIA Caffe
安装依赖库
sudo apt install -y build-essential cmake git gfortran libopenblas-dev libboost-all-dev libgflags-dev libgoogle-glog-dev libhdf5-serial-dev libleveldb-dev liblmdb-dev libopencv-dev libsnappy-dev python-all-dev python-dev python-h5py python-matplotlib python-numpy python-opencv python-pil python-pip python-pydot python-scipy python-skimage python-sklearn libturbojpeg0-dev libfreetype6-dev
下载 NVIDIA Caffe
git clone https://github.com/NVIDIA/caffe ~/caffe -b 'caffe-0.17'
安装 Python 库
sudo apt install python-leveldb
vim ~/caffe/python/requirements.txt
</leveldb>
<dd>
<:wq>
sudo -H pip install -r ~/caffe/python/requirements.txt
编译 NVDIA Caffe
cd ~/caffe
mkdir build
cd build
cmake ..
sudo make -j6
sudo make install
配置环境变量
vim ~/.bashrc
<G>
<o>
export PYTHONPATH=/home/nvidia/caffe/python
<ESC>
<:wq>
source ~/.bashrc
测试
python
>>> import caffe
>>>
参考
- 《基于 NVIDIA Jetson 平台的人工智能实例开发入门》,李丹丹,姜宇,哈尔滨工业大学出版社