Table of Contents
1.配置
python:一定要用python2
cuda:9.0
参考:https://github.com/facebookresearch/DensePose/blob/master/INSTALL.md
2.CAFFE2安装
参考官网:https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=prebuilt
conda create -n caffe2 python=2.7
conda create caffe2
conda install pytorch-nightly -c pytorch
ImportError: No module named google.protobuf.internal
solution:
conda install cython
conda install protobuf
ImportError: No module named past.builtins
solution:conda install future
# To check if Caffe2 build was successful
python2 -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
# To check if Caffe2 GPU build was successful
# This must print a number > 0 in order to use Detectron
python2 -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
3.COCOAPI
# COCOAPI=/path/to/clone/cocoapi
git clone https://github.com/cocodataset/cocoapi.git $COCOAPI
cd $COCOAPI/PythonAPI
# Install into global site-packages
make install
eeror: gcc: error: pycocotools/_mask.c: No such file or directory
solution:conda install cython
error: Setup script exited with
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4.
Beginning with Matplotlib 3.0, Python 3.5 and above is required.
solution:conda install python = 3.6
error: option --user not recognized
solution:修改makefile
export COCOAPI="/home/hellboy/yhwang/1_projects/3_Densepose/1_densepose/cocoapi"
#此命令仅在该bash下生效
3.DensePOSE
记得退回densepose目录
git clone https://github.com/facebookresearch/densepose $DENSEPOSE
export DENSEPOSE=/home/hellboy/yhwang/1_projects/3_Densepose/1_densepose/densepose
pip install -r $DENSEPOSE/requirements.txt
cd $DENSEPOSE && make
python2 $DENSEPOSE/detectron/tests/test_spatial_narrow_as_op.py
ImportError: No module named past.builtins
solution:
conda remove python=3.6
pip install future(用conda install future总是会自动安装python3.6)
error: no module named numpy
solution:conda install numpy
error:AssertionError: Detectron ops lib not found; make sure that your Caffe2 version includes Detectron module
solution:https://blog.csdn.net/zziahgf/article/details/79141879