首先搭建环境:
1、安装gcc-4.9,g++-4.9 命令(之所以安装4.9版本是因为目前的caffe2编译安装不支持5以上的版本,回报错):
-
sudo apt-get update
-
sudo apt-get install build-essential software-properties-common -y
-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
-
sudo apt-get update
-
sudo apt-get install gcc-snapshot -y
-
sudo apt-get update
-
sudo apt-get install gcc-4.9 g++-4.9 -y
-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
2、安装cuda9.0, cudnn7.1.2:
按照官网的方法安装cuda:https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
cudnn安装:https://blog.csdn.net/qq_34877350/article/details/78554650
注意安装完cuda9要重启一下机器
3、安装anaconda3:
按照anaconda3官网安装步骤,这个简单
4、 下载caffe2:
git clone --recursive https://github.com/pytorch/pytorch.git && cd pytorch
git submodule update --init
因为caffe2和pytorch合并了,所以下载pytorch
5、 按照https://github.com/facebookresearch/DetectAndTrack
这里的安装步骤来安装,主要是用到了这个库的安装依赖,可以省去很多麻烦,只是下载caffe2的步骤变成了第4步那个,其他都按照这个库的步骤来