cuda 10.0 pytorch 1.4.0 python 3.8 /3.7 torchvision 0.5.0
conda create -n detectron2
conda activate detectron2
conda install pip
pip install cython
pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
安装对应的torch
安装gcc g++,版本要一致
pip install -i https://pypi.douban.com/simple/ pyyaml==5.1.1
sudo apt-get install ninja-build
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu100/torch1.4/index.html
name: detectron2
channels:
- pytorch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- blas=1.0=mkl
- ca-certificates=2020.7.22=0
- certifi=2020.6.20=py38_0
- cudatoolkit=10.0.130=0
- freetype=2.10.2=h5ab3b9f_0
- intel-openmp=2020.1=217
- jpeg=9b=h024ee3a_2
- lcms2=2.11=h396b838_0
- ld_impl_linux-64=2.33.1=h53a641e_7
- libedit=3.1.20191231=h14c3975_1
- libffi=3.3=he6710b0_2
- libgcc-ng=9.1.0=hdf63c60_0
- libpng=1.6.37=hbc83047_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- libtiff=4.1.0=h2733197_1
- lz4-c=1.9.2=he6710b0_1
- mkl=2020.1=217
- mkl-service=2.3.0=py38he904b0f_0
- mkl_fft=1.1.0=py38h23d657b_0
- mkl_random=1.1.1=py38h0573a6f_0
- ncurses=6.2=he6710b0_1
- ninja=1.10.0=py38hfd86e86_0
- numpy=1.19.1=py38hbc911f0_0
- numpy-base=1.19.1=py38hfa32c7d_0
- olefile=0.46=py_0
- openssl=1.1.1g=h7b6447c_0
- pillow=7.2.0=py38hb39fc2d_0
- pip=20.2.2=py38_0
- python=3.8.5=hcff3b4d_0
- pytorch=1.4.0=py3.8_cuda10.0.130_cudnn7.6.3_0
- readline=8.0=h7b6447c_0
- setuptools=49.6.0=py38_0
- six=1.15.0=py_0
- sqlite=3.33.0=h62c20be_0
- tk=8.6.10=hbc83047_0
- torchvision=0.5.0=py38_cu100
- wheel=0.35.1=py_0
- xz=5.2.5=h7b6447c_0
- zlib=1.2.11=h7b6447c_3
- zstd=1.4.5=h9ceee32_0
- pip:
- absl-py==0.10.0
- cachetools==4.1.1
- chardet==3.0.4
- cloudpickle==1.6.0
- cycler==0.10.0
- cython==0.29.21
- detectron2==0.2.1+cu100
- future==0.18.2
- fvcore==0.1.1.post20200716
- google-auth==1.20.1
- google-auth-oauthlib==0.4.1
- grpcio==1.31.0
- idna==2.10
- kiwisolver==1.2.0
- markdown==3.2.2
- matplotlib==3.3.1
- mock==4.0.2
- oauthlib==3.1.0
- portalocker==2.0.0
- protobuf==3.13.0
- pyasn1==0.4.8
- pyasn1-modules==0.2.8
- pycocotools==2.0.1
- pydot==1.4.1
- pyparsing==2.4.7
- python-dateutil==2.8.1
- pyyaml==5.1.1
- requests==2.24.0
- requests-oauthlib==1.3.0
- rsa==4.6
- tabulate==0.8.7
- tensorboard==2.3.0
- tensorboard-plugin-wit==1.7.0
- termcolor==1.1.0
- tqdm==4.48.2
- urllib3==1.25.10
- werkzeug==1.0.1
- yacs==0.1.8
prefix: /home/zs/miniconda3/envs/detectron2
CUDA11.0,TORCH1.7
conda create -n detectron2 python=3.7
python -m pip install detectron2 -f \
https://dl.fbaipublicfiles.com/detectron2/wheels/cu110/torch1.7/index.html
pip install torch===1.7.1+cu110 torchvision===0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
name: detectron2
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- ca-certificates=2020.12.8=h06a4308_0
- certifi=2020.12.5=py37h06a4308_0
- ld_impl_linux-64=2.33.1=h53a641e_7
- libedit=3.1.20191231=h14c3975_1
- libffi=3.3=he6710b0_2
- libgcc-ng=9.1.0=hdf63c60_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- ncurses=6.2=he6710b0_1
- openssl=1.1.1i=h27cfd23_0
- pip=20.3.3=py37h06a4308_0
- python=3.7.9=h7579374_0
- readline=8.0=h7b6447c_0
- setuptools=51.0.0=py37h06a4308_2
- sqlite=3.33.0=h62c20be_0
- tk=8.6.10=hbc83047_0
- xz=5.2.5=h7b6447c_0
- zlib=1.2.11=h7b6447c_3
- pip:
- cloudpickle==1.6.0
- cython==0.29.21
- detectron2==0.3+cu110
- future==0.18.2
- fvcore==0.1.2.post20201218
- iopath==0.1.2
- pillow==8.0.1
- polygon3==3.0.8
- pycocotools==2.0.2
- python-levenshtein==0.12.0
- tensorboard==1.15.0
- torch==1.7.1+cu110
- torchaudio==0.7.2
- torchvision==0.8.2+cu110
- typing-extensions==3.7.4.3
- wheel==0.36.2
prefix: /home/zs/miniconda3/envs/detectron2
detectron coco数据集配置:
修改detectron2环境下的data/dataset/coco.py
def register_coco_instances(name, metadata, json_file, image_root):
加上两句话
json_file = ‘你的train2014.json路径’
image_root =‘你的coco_train2014’