conda create -n Pose python=2.7
source activate Pose
#安装依赖
conda install -y \
future
gflags
leveldb
mkl
mkl-include
numpy
opencv
protobuf
six
#安装caffe2
conda install pytorch-nightly -c pytorch
or
#安装cocoapi
git clone https://github.com/cocodataset/cocoapi.gitTOC
cd cocoapi/PythonAPI
make install
#安装detectron
git clone https://github.com/facebookresearch/detectron
cd detectron && make
#报错AssertionError: Detectron ops lib not found; make sure that your Caffe2 version includes Detectron module
添加路径在detectron/utils/env.py
sys.path.insert(0, ‘/home/lyl/anaconda3/pkgs/pytorch-nightly-1.0.0.dev20181105-py2.7_cuda9.0.176_cudnn7.1.2_0/lib/python2.7/site-packages/torch/lib’)
#安装cudnn
CUDNN_URL=“http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz”
wget ${CUDNN_URL}
#在detectron中make ops出现错误
cmake … -DCaffe2_DIR=/home/lyl/anaconda3/pkgs/pytorch-nightly-1.0.0.dev20181105-py2.7_cuda9.0.176_cudnn7.1.2_0/lib/python2.7/site-packages/torch/share/cmake/Caffe2
#错误:fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
conda unstall protobuf
conda install -c anaconda protobuf=2.6.1