forked from jkjung-avt/jetson_nano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_ssd-caffe.sh
executable file
·44 lines (34 loc) · 1.42 KB
/
install_ssd-caffe.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
config_file=`pwd`/caffe/Makefile.config.nano
project_folder=${HOME}/project
mkdir -p $project_folder
echo "** Install requirements"
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install -y --no-install-recommends libboost-all-dev
sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-get install -y libatlas-base-dev libopenblas-dev
echo "** Download SSD caffe"
cd $project_folder
git clone https://github.com/weiliu89/caffe.git ssd-caffe
cd ssd-caffe
git checkout ssd
echo "** Install python3 requirements"
# build python3 leveldb from source
pushd /tmp
wget https://pypi.python.org/packages/03/98/1521e7274cfbcc678e9640e242a62cbcd18743f9c5761179da165c940eac/leveldb-0.20.tar.gz
tar xzvf leveldb-0.20.tar.gz
cd leveldb-0.20
python3 setup.py build
sudo python3 setup.py install
popd
pkgs=`sed 's/[>=<].*$//' python/requirements.txt | grep -v leveldb | grep -v pyyaml`
for pkg in $pkgs; do sudo pip3 install $pkg; done
echo "** Building caffe..."
cp $config_file Makefile.config
make -j$(nproc) all test pycaffe
# NOTE: runtest fails on Jetson Nano due to out of memory
# make runtest
./build/tools/caffe time --gpu 0 --model ./models/bvlc_alexnet/deploy.prototxt
PYTHONPATH=`pwd`/python python3 -c "import caffe; print('caffe version: %s' % caffe.__version__)"
echo "** Build and test SSD caffe successfully"