Updating Dockerfiles From Docker Directory and get_started.md to Reach Last Stable Version of Python, PyTorch and MMCV (#1446)

* Update Dockerfile

Compatible with the latest version of MMCV and PyTorch for compatibility with Python3.10

* Update Dockerfile for serve

Compatible with the latest version of MMCV and PyTorch for compatibility with Python3.10

* Updating to the last version of supported Python

* Update Dockerfile

* Update get_started.md

* Update docs/zh_cn/get_started.md

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>

Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com>
This commit is contained in:
AmirMasoud Nourollah 2022-04-04 16:46:50 +04:30 committed by GitHub
parent 1a7c045867
commit cc202a1664
4 changed files with 29 additions and 29 deletions

View File

@ -1,7 +1,7 @@
ARG PYTORCH="1.6.0" ARG PYTORCH="1.11.0"
ARG CUDA="10.1" ARG CUDA="11.3"
ARG CUDNN="7" ARG CUDNN="8"
ARG MMCV="1.3.13" ARG MMCV="1.4.8"
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
@ -19,7 +19,7 @@ RUN conda clean --all
ARG PYTORCH ARG PYTORCH
ARG CUDA ARG CUDA
ARG MMCV ARG MMCV
RUN ["/bin/bash", "-c", "pip install mmcv-full==${MMCV} -f https://download.openmmlab.com/mmcv/dist/cu${CUDA//./}/torch${PYTORCH}/index.html"] RUN ["/bin/bash", "-c", "pip install --no-cache-dir mmcv-full==${MMCV} -f https://download.openmmlab.com/mmcv/dist/cu${CUDA//./}/torch${PYTORCH}/index.html"]
# Install MMSegmentation # Install MMSegmentation
RUN git clone https://github.com/open-mmlab/mmsegmentation.git /mmsegmentation RUN git clone https://github.com/open-mmlab/mmsegmentation.git /mmsegmentation

View File

@ -1,9 +1,9 @@
ARG PYTORCH="1.6.0" ARG PYTORCH="1.11.0"
ARG CUDA="10.1" ARG CUDA="11.3"
ARG CUDNN="7" ARG CUDNN="8"
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
ARG MMCV="1.4.4" ARG MMCV="1.4.8"
ARG MMSEG="0.23.0" ARG MMSEG="0.23.0"
ENV PYTHONUNBUFFERED TRUE ENV PYTHONUNBUFFERED TRUE

View File

@ -42,16 +42,16 @@ If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.
a. Create a conda virtual environment and activate it. a. Create a conda virtual environment and activate it.
```shell ```shell
conda create -n open-mmlab python=3.7 -y conda create -n open-mmlab python=3.10 -y
conda activate open-mmlab conda activate open-mmlab
``` ```
b. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/). b. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/).
Here we use PyTorch 1.6.0 and CUDA 10.1. Here we use PyTorch 1.11.0 and CUDA 11.3.
You may also switch to other version by specifying the version number. You may also switch to other version by specifying the version number.
```shell ```shell
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
``` ```
c. Install [MMCV](https://mmcv.readthedocs.io/en/latest/) following the [official instructions](https://mmcv.readthedocs.io/en/latest/#installation). c. Install [MMCV](https://mmcv.readthedocs.io/en/latest/) following the [official instructions](https://mmcv.readthedocs.io/en/latest/#installation).
@ -68,10 +68,10 @@ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{
Please replace ``{cu_version}`` and ``{torch_version}`` in the url to your desired one. mmcv-full is only compiled on Please replace ``{cu_version}`` and ``{torch_version}`` in the url to your desired one. mmcv-full is only compiled on
PyTorch 1.x.0 because the compatibility usually holds between 1.x.0 and 1.x.1. If your PyTorch version is 1.x.1, PyTorch 1.x.0 because the compatibility usually holds between 1.x.0 and 1.x.1. If your PyTorch version is 1.x.1,
you can install mmcv-full compiled with PyTorch 1.x.0 and it usually works well. you can install mmcv-full compiled with PyTorch 1.x.0 and it usually works well.
For example, to install the ``mmcv-full`` with ``CUDA 10.1`` and ``PyTorch 1.6.0``, use the following command: For example, to install the ``mmcv-full`` with ``CUDA 11.3`` and ``PyTorch 1.11.0``, use the following command:
```shell ```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6/index.html pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11/index.html
``` ```
See [here](https://github.com/open-mmlab/mmcv#installation) for different versions of MMCV compatible to different PyTorch and CUDA versions. See [here](https://github.com/open-mmlab/mmcv#installation) for different versions of MMCV compatible to different PyTorch and CUDA versions.
@ -155,11 +155,11 @@ pip install -e . # or "python setup.py develop"
Here is a full script for setting up mmsegmentation with conda and link the dataset path (supposing that your dataset path is $DATA_ROOT). Here is a full script for setting up mmsegmentation with conda and link the dataset path (supposing that your dataset path is $DATA_ROOT).
```shell ```shell
conda create -n open-mmlab python=3.7 -y conda create -n open-mmlab python=3.10 -y
conda activate open-mmlab conda activate open-mmlab
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11.0/index.html
git clone https://github.com/open-mmlab/mmsegmentation.git git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation cd mmsegmentation
pip install -e . # or "python setup.py develop" pip install -e . # or "python setup.py develop"
@ -174,10 +174,10 @@ Here is a full script for setting up mmsegmentation with conda and link the data
%DATA_ROOT%. Notice: It must be an absolute path). %DATA_ROOT%. Notice: It must be an absolute path).
```shell ```shell
conda create -n open-mmlab python=3.7 -y conda create -n open-mmlab python=3.10 -y
conda activate open-mmlab conda activate open-mmlab
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
set PATH=full\path\to\your\cpp\compiler;%PATH% set PATH=full\path\to\your\cpp\compiler;%PATH%
pip install mmcv pip install mmcv

View File

@ -40,17 +40,17 @@
a. 创建一个 conda 虚拟环境并激活它 a. 创建一个 conda 虚拟环境并激活它
```shell ```shell
conda create -n open-mmlab python=3.7 -y conda create -n open-mmlab python=3.10 -y
conda activate open-mmlab conda activate open-mmlab
``` ```
b. 按照[官方教程](https://pytorch.org/) 安装 PyTorch 和 totchvision b. 按照[官方教程](https://pytorch.org/) 安装 PyTorch 和 totchvision
这里我们使用 PyTorch1.6.0 和 CUDA10.1 这里我们使用 PyTorch1.11.0 和 CUDA11.3
您也可以切换至其他版本 您也可以切换至其他版本
```shell ```shell
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
``` ```
c. 按照 [官方教程](https://mmcv.readthedocs.io/en/latest/#installation) c. 按照 [官方教程](https://mmcv.readthedocs.io/en/latest/#installation)
@ -68,10 +68,10 @@ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{
请替换 url 里面的 ``{cu_version}`` 和 ``{torch_version}`` 为您想要使用的版本. mmcv-full 仅在 请替换 url 里面的 ``{cu_version}`` 和 ``{torch_version}`` 为您想要使用的版本. mmcv-full 仅在
PyTorch 1.x.0 上面编译, 因为在 1.x.0 和 1.x.1 之间通常是兼容的. 如果您的 PyTorch 版本是 1.x.1, PyTorch 1.x.0 上面编译, 因为在 1.x.0 和 1.x.1 之间通常是兼容的. 如果您的 PyTorch 版本是 1.x.1,
您可以安装用 PyTorch 1.x.0 编译的 mmcv-full 而它通常是可以正常使用的. 您可以安装用 PyTorch 1.x.0 编译的 mmcv-full 而它通常是可以正常使用的.
例如, 用 ``CUDA 10.1`` and ``PyTorch 1.6.0`` 安装使用 ``mmcv-full``, 使用如下命令: 例如, 用 ``CUDA 11.1`` and ``PyTorch 1.11.0`` 安装使用 ``mmcv-full``, 使用如下命令:
```shell ```shell
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6/index.html pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11/index.html
``` ```
请查看 [这里](https://github.com/open-mmlab/mmcv#installation) 来找到适配不同 PyTorch 和 CUDA 版本的 MMCV. 请查看 [这里](https://github.com/open-mmlab/mmcv#installation) 来找到适配不同 PyTorch 和 CUDA 版本的 MMCV.
@ -155,11 +155,11 @@ pip install -e . # 或者 "python setup.py develop"
这里便是一个完整安装 MMSegmentation 的脚本,使用 conda 并链接了数据集的路径(以您的数据集路径为 $DATA_ROOT 来安装)。 这里便是一个完整安装 MMSegmentation 的脚本,使用 conda 并链接了数据集的路径(以您的数据集路径为 $DATA_ROOT 来安装)。
```shell ```shell
conda create -n open-mmlab python=3.7 -y conda create -n open-mmlab python=3.10 -y
conda activate open-mmlab conda activate open-mmlab
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
pip install mmcv-full==latest+torch1.5.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11.0/index.html
git clone https://github.com/open-mmlab/mmsegmentation.git git clone https://github.com/open-mmlab/mmsegmentation.git
cd mmsegmentation cd mmsegmentation
pip install -e . # 或者 "python setup.py develop" pip install -e . # 或者 "python setup.py develop"
@ -174,10 +174,10 @@ ln -s $DATA_ROOT data
注意:它必须是一个绝对路径。 注意:它必须是一个绝对路径。
```shell ```shell
conda create -n open-mmlab python=3.7 -y conda create -n open-mmlab python=3.10 -y
conda activate open-mmlab conda activate open-mmlab
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
set PATH=full\path\to\your\cpp\compiler;%PATH% set PATH=full\path\to\your\cpp\compiler;%PATH%
pip install mmcv pip install mmcv