环境介绍
torch版本:1.2.0
Python版本:3.6
torchvision版本:0.2.0
需要tqdm、tensorboardX
Ubuntu18.04(这是我自己的系统版本)
项目地址
服务器环境验证
查看环境版本的命令
lsb_release -a #查看系统版本
$ python -V #查看python版本
$ python -v
>>import torch
>>print(torch.__version__) # 查看torch版本
>>print(torch.version.cuda) #查看torch里cuda编译版本
>>exit #退出
$ nvcc -V #查看cuda版本
$ nvidia-smi #查看GPU情况
一、克隆项目
我们先将easy-fpn.pytorch的仓库克隆到你想要存放的文件夹下,比如我这里是pycharmprojects,输入以下命令:
$ cd PROJECT_DIR
$ git clone https://github.com/MingtaoFu/gliding_vertex.git
二、编译环境
1.项目结构
该项目是基于facebookresearch/maskrcnn-benchmark进行改写,所以在编译该项目之前要先按照facebook的项目进行环境的编译。
2.maskrcnn-benchmark依赖编译
- PyTorch
- torchvision
- cocoapi
- yacs
- matplotlib
- GCC >= 4.9
- OpenCV
- CUDA >= 9.0
# first, make sure that your conda is setup properly with the right environment
# for that, check that `which conda`, `which pip` and `which python` points to the
# right path. From a clean conda env, this is what you need to do
~$ cd PROJECT_DIR/gliding_vertex
PROJECT_DIR/gliding_vertex$ conda create --name ENV_NAME(虚拟环境名称) python=3.6
PROJECT_DIR/gliding_vertex$ cd ../../
~$ vi .bashrc
# 添加如下内容
alias gliding-3.6="conda activate ENV_NAME"
~$ source .bashrc
~$ gliding-3.6
(ENV_NAME)~$ cd PROJECT_DIR/gliding_vertex
# maskrcnn_benchmark and coco api dependencies
(ENV_NAME)PROJECT_DIR/gliding_vertex$ pip install ninja yacs cython matplotlib tqdm opencv-python
# follow PyTorch installation in https://pytorch.org/get-started/locally/
(ENV_NAME)PROJECT_DIR/gliding_vertex$ pip install torch==1.2
(ENV_NAME)PROJECT_DIR/gliding_vertex$ pip install torchvision==0.2.0
# install pycocotools
(ENV_NAME)PROJECT_DIR/gliding_vertex$ git clone https://github.com/cocodataset/cocoapi.git
(ENV_NAME)PROJECT_DIR/gliding_vertex$ cd cocoapi/PythonAPI
(ENV_NAME)PROJECT_DIR/gliding_vertex/cocoapi$ python setup.py build_ext install
(EN