mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
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:
parent
1a7c045867
commit
cc202a1664
@ -1,7 +1,7 @@
|
||||
ARG PYTORCH="1.6.0"
|
||||
ARG CUDA="10.1"
|
||||
ARG CUDNN="7"
|
||||
ARG MMCV="1.3.13"
|
||||
ARG PYTORCH="1.11.0"
|
||||
ARG CUDA="11.3"
|
||||
ARG CUDNN="8"
|
||||
ARG MMCV="1.4.8"
|
||||
|
||||
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
|
||||
|
||||
@ -19,7 +19,7 @@ RUN conda clean --all
|
||||
ARG PYTORCH
|
||||
ARG CUDA
|
||||
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
|
||||
RUN git clone https://github.com/open-mmlab/mmsegmentation.git /mmsegmentation
|
||||
|
@ -1,9 +1,9 @@
|
||||
ARG PYTORCH="1.6.0"
|
||||
ARG CUDA="10.1"
|
||||
ARG CUDNN="7"
|
||||
ARG PYTORCH="1.11.0"
|
||||
ARG CUDA="11.3"
|
||||
ARG CUDNN="8"
|
||||
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
|
||||
|
||||
ARG MMCV="1.4.4"
|
||||
ARG MMCV="1.4.8"
|
||||
ARG MMSEG="0.23.0"
|
||||
|
||||
ENV PYTHONUNBUFFERED TRUE
|
||||
|
@ -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.
|
||||
|
||||
```shell
|
||||
conda create -n open-mmlab python=3.7 -y
|
||||
conda create -n open-mmlab python=3.10 -y
|
||||
conda activate open-mmlab
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
```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).
|
||||
@ -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
|
||||
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.
|
||||
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
|
||||
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.
|
||||
@ -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).
|
||||
|
||||
```shell
|
||||
conda create -n open-mmlab python=3.7 -y
|
||||
conda create -n open-mmlab python=3.10 -y
|
||||
conda activate open-mmlab
|
||||
|
||||
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch
|
||||
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
|
||||
conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
|
||||
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
|
||||
cd mmsegmentation
|
||||
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).
|
||||
|
||||
```shell
|
||||
conda create -n open-mmlab python=3.7 -y
|
||||
conda create -n open-mmlab python=3.10 -y
|
||||
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%
|
||||
pip install mmcv
|
||||
|
||||
|
@ -40,17 +40,17 @@
|
||||
a. 创建一个 conda 虚拟环境并激活它
|
||||
|
||||
```shell
|
||||
conda create -n open-mmlab python=3.7 -y
|
||||
conda create -n open-mmlab python=3.10 -y
|
||||
conda activate open-mmlab
|
||||
|
||||
```
|
||||
|
||||
b. 按照[官方教程](https://pytorch.org/) 安装 PyTorch 和 totchvision,
|
||||
这里我们使用 PyTorch1.6.0 和 CUDA10.1,
|
||||
这里我们使用 PyTorch1.11.0 和 CUDA11.3,
|
||||
您也可以切换至其他版本
|
||||
|
||||
```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)
|
||||
@ -68,10 +68,10 @@ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{
|
||||
请替换 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 编译的 mmcv-full 而它通常是可以正常使用的.
|
||||
例如, 用 ``CUDA 10.1`` and ``PyTorch 1.6.0`` 安装使用 ``mmcv-full``, 使用如下命令:
|
||||
例如, 用 ``CUDA 11.1`` and ``PyTorch 1.11.0`` 安装使用 ``mmcv-full``, 使用如下命令:
|
||||
|
||||
```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.
|
||||
@ -155,11 +155,11 @@ pip install -e . # 或者 "python setup.py develop"
|
||||
这里便是一个完整安装 MMSegmentation 的脚本,使用 conda 并链接了数据集的路径(以您的数据集路径为 $DATA_ROOT 来安装)。
|
||||
|
||||
```shell
|
||||
conda create -n open-mmlab python=3.7 -y
|
||||
conda create -n open-mmlab python=3.10 -y
|
||||
conda activate open-mmlab
|
||||
|
||||
conda install pytorch=1.6.0 torchvision cudatoolkit=10.1 -c pytorch
|
||||
pip install mmcv-full==latest+torch1.5.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html
|
||||
conda install pytorch=1.11.0 torchvision cudatoolkit=11.3 -c pytorch
|
||||
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
|
||||
cd mmsegmentation
|
||||
pip install -e . # 或者 "python setup.py develop"
|
||||
@ -174,10 +174,10 @@ ln -s $DATA_ROOT data
|
||||
注意:它必须是一个绝对路径。
|
||||
|
||||
```shell
|
||||
conda create -n open-mmlab python=3.7 -y
|
||||
conda create -n open-mmlab python=3.10 -y
|
||||
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%
|
||||
pip install mmcv
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user