配置MMskeleton:ST-gcn

配置MMskeleton:ST-gcn

  • Conda 虚拟环境
    • Clone MMskeleton
    • 搭建mmskeleton
      • 搭建mmdetection
        • 安装 mmdetection
        • 测试mmdetection
      • 在安装mmskeleton
      • 测试mmskeleton

Conda 虚拟环境

wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
sudo bash Anaconda3-2019.10-Linux-x86_64.sh
conda create -n open-mmlab python=3.7 -y
conda activate open-mmlab

Clone MMskeleton

git clone https://github.com/open-mmlab/mmskeleton.git
cd mmskeleton

搭建mmskeleton

python setup.py develop
这个过程不可能一步到位的,需要安装mmdetection(https://github.com/open-mmlab/mmdetection/blob/master/docs/INSTALL.md),特别的麻烦。下面是关于mmdetection的搭建

搭建mmdetection

需要环境
Linux (Windows is not officially supported)
Python 3.5+ (Python 2 is not supported)
PyTorch 1.1 or higher
CUDA 9.0 or higher
NCCL 2
GCC(G++) 4.9 or higher
mmcv
测试通过的os和版本(切记要版本匹配,比如:gcc是6.3就不行,会报错,但是4.9就可以
OS: Ubuntu 16.04/18.04 and CentOS 7.2
CUDA: 9.0/9.2/10.0
NCCL: 2.1.15/2.2.13/2.3.7/2.4.2
GCC(G++): 4.9/5.3/5.4/7.3

安装 mmdetection

a. Install PyTorch stable or nightly and torchvision following the official instructions, e.g.,

conda install pytorch torchvision -c pytorch

b. Clone the mmdetection repository.
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection

c. Install mmdetection (other dependencies will be installed automatically).
python setup.py develop or “pip install -v -e .”
有时候python指令安装会报错,然后pip install不会报错,总之交替使用吧,这个中间又会遇到很多坑

  1. 改变conda的环境下的gcc版本,相关链接在这里:https://www.zhihu.com/question/56272908?sort=created
  2. import pycocotools/_mask.so报错,相关链接:https://github.com/cocodataset/cocoapi/issues/35 和 https://github.com/cocodataset/cocoapi/issues/59
  3. ImportError: …/Lib/nms/gpu_nms.so: undefined symbol: 相关链接:https://github.com/rbgirshick/py-faster-rcnn/issues/559,有时候还需要把之前目录的.so文件删除,然后重新生成,里面很多相关·问题,在搭建fast_rcnn中都会遇到类似的问题

测试mmdetection

python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [–out ${RESULT_FILE}] [–eval ${EVAL_METRICS}] [–show]

在安装mmskeleton

又会碰到import error gpu_nms.so的问题,需要把之前错误生成的.so文件或者相关文件删除,再重新安装,基本上问题不大了。

测试mmskeleton

python mmskl.py pose_demo [–gpus $GPUS]
or “python mmskl.py pose_demo_HD [–gpus $GPUS]” for a higher accuracy

你可能感兴趣的:(机器学习环境搭建)