From 3dcaf04c0d3004a489328c31a30bec6de97cde55 Mon Sep 17 00:00:00 2001 From: Ma Zerun Date: Tue, 4 Jan 2022 11:38:05 +0800 Subject: [PATCH] [Docs] Update install guide and README (#624) * Update install guide * Add new repos in README and use readthedocs link preferentially. * Add MMRazor * Improve README * Imporve docs * Imporve docs --- README.md | 31 +++++---- README_zh-CN.md | 30 +++++---- docs/en/install.md | 147 ++++++++++++++++++++++++------------------ docs/zh_CN/install.md | 133 ++++++++++++++++++++++---------------- 4 files changed, 200 insertions(+), 141 deletions(-) diff --git a/README.md b/README.md index 1180813aefe..a15894d41bb 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Please refer to [changelog.md](docs/en/changelog.md) for more details and other ## Benchmark and model zoo -Results and models are available in the [model zoo](docs/en/model_zoo.md). +Results and models are available in the [model zoo](https://mmclassification.readthedocs.io/en/latest/model_zoo.html).
Supported backbones @@ -85,21 +85,23 @@ Results and models are available in the [model zoo](docs/en/model_zoo.md). ## Installation -Please refer to [install.md](docs/en/install.md) for installation and dataset preparation. +Please refer to [install.md](https://mmclassification.readthedocs.io/en/latest/install.html) for installation and dataset preparation. ## Getting Started -Please see [getting_started.md](docs/en/getting_started.md) for the basic usage of MMClassification. There are also tutorials: +Please see [Getting Started](https://mmclassification.readthedocs.io/en/latest/getting_started.html) for the basic usage of MMClassification. There are also tutorials: -- [learn about configs](docs/en/tutorials/config.md) -- [finetuning models](docs/en/tutorials/finetune.md) -- [adding new dataset](docs/en/tutorials/new_dataset.md) -- [designing data pipeline](docs/en/tutorials/data_pipeline.md) -- [adding new modules](docs/en/tutorials/new_modules.md) -- [customizing schedule](docs/en/tutorials/schedule.md) -- [customizing runtime settings](docs/en/tutorials/runtime.md) +- [Learn about Configs](https://mmclassification.readthedocs.io/en/latest/tutorials/config.html) +- [Fine-tune Models](https://mmclassification.readthedocs.io/en/latest/tutorials/finetune.html) +- [Add New Dataset](https://mmclassification.readthedocs.io/en/latest/tutorials/new_dataset.html) +- [Customizie Data Pipeline](https://mmclassification.readthedocs.io/en/latest/tutorials/data_pipeline.html) +- [Add New Modules](https://mmclassification.readthedocs.io/en/latest/tutorials/new_modules.html) +- [Customizie Schedule](https://mmclassification.readthedocs.io/en/latest/tutorials/schedule.html) +- [Customizie Runtime Settings](https://mmclassification.readthedocs.io/en/latest/tutorials/runtime.html) -Colab tutorials are also provided. To learn about MMClassification Python API, you may preview the notebook [here](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb) or directly [run](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb) on Colab. -To learn about MMClassification shell tools, you may preview the notebook [here](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb) or directly [run](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb) on Colab. +Colab tutorials are also provided: + +- Learn about MMClassification **Python API**: [Preview the notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb) or directly [run on Colab](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_python.ipynb). +- Learn about MMClassification **CLI tools**: [Preview the notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb) or directly [run on Colab](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/en/tutorials/MMClassification_tools.ipynb). ## Citation @@ -117,7 +119,7 @@ If you find this project useful in your research, please consider cite: ## Contributing We appreciate all contributions to improve MMClassification. -Please refer to [CONTRUBUTING.md](docs/en/community/CONTRIBUTING.md) for the contributing guideline. +Please refer to [CONTRUBUTING.md](https://mmclassification.readthedocs.io/en/latest/community/CONTRIBUTING.html) for the contributing guideline. ## Acknowledgement @@ -141,3 +143,6 @@ We wish that the toolbox and benchmark could serve the growing research communit - [MMFlow](https://github.com/open-mmlab/mmflow) OpenMMLab optical flow toolbox and benchmark. - [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab FewShot Learning Toolbox and Benchmark. - [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D Human Parametric Model Toolbox and Benchmark. +- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab self-supervised learning toolbox and benchmark. +- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab Model Compression Toolbox and Benchmark. +- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab Model Deployment Framework. diff --git a/README_zh-CN.md b/README_zh-CN.md index 858a3568609..a2be522d00a 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -52,7 +52,7 @@ MMClassification 是一款基于 PyTorch 的开源图像分类工具箱,是 [O ## 基准测试及模型库 -相关结果和模型可在 [model zoo](docs/en/model_zoo.md) 中获得 +相关结果和模型可在 [model zoo](https://mmclassification.readthedocs.io/en/latest/model_zoo.html) 中获得
支持的主干网络 @@ -84,25 +84,28 @@ MMClassification 是一款基于 PyTorch 的开源图像分类工具箱,是 [O ## 安装 -请参考 [安装指南](docs/zh_CN/install.md) 进行安装 +请参考 [安装指南](https://mmclassification.readthedocs.io/zh_CN/latest/install.html) 进行安装 ## 基础教程 -请参考 [基础教程](docs/zh_CN/getting_started.md) 来了解 MMClassification 的基本使用。MMClassification 也提供了其他更详细的教程: +请参考 [基础教程](https://mmclassification.readthedocs.io/zh_CN/latest/getting_started.html) 来了解 MMClassification 的基本使用。MMClassification 也提供了其他更详细的教程: -- [如何编写配置文件](docs/zh_CN/tutorials/config.md) -- [如何微调模型](docs/zh_CN/tutorials/finetune.md) -- [如何增加新数据集](docs/zh_CN/tutorials/new_dataset.md) -- [如何设计数据处理流程](/docs/zh_CN/tutorials/data_pipeline.md) -- [如何增加新模块](docs/zh_CN/tutorials/new_modules.md) -- [如何自定义优化策略](docs/zh_CN/tutorials/schedule.md) -- [如何自定义运行参数](docs/zh_CN/tutorials/runtime.md) +- [如何编写配置文件](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/config.html) +- [如何微调模型](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/finetune.html) +- [如何增加新数据集](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/new_dataset.html) +- [如何设计数据处理流程](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/data_pipeline.html) +- [如何增加新模块](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/new_modules.html) +- [如何自定义优化策略](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/schedule.html) +- [如何自定义运行参数](https://mmclassification.readthedocs.io/zh_CN/latest/tutorials/runtime.html) -MMClassification 也提供了相应的中文 Colab 教程。了解 MMClassification Python API,可以查看 [这里](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb) 或者直接在 Colab 上 [运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb)。了解 MMClassification 命令行工具,可以查看 [这里](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb) 或者直接在 Colab 上 [运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb)。 +我们也提供了相应的中文 Colab 教程: + +- 了解 MMClassification **Python API**:[预览 Notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb) 或者直接[在 Colab 上运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_python_cn.ipynb)。 +- 了解 MMClassification **命令行工具**:[预览 Notebook](https://github.com/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb) 或者直接[在 Colab 上运行](https://colab.research.google.com/github/open-mmlab/mmclassification/blob/master/docs/zh_CN/tutorials/MMClassification_tools_cn.ipynb)。 ## 参与贡献 -我们非常欢迎任何有助于提升 MMClassification 的贡献,请参考 [贡献指南](docs/zh_CN/community/CONTRIBUTING.md) 来了解如何参与贡献。 +我们非常欢迎任何有助于提升 MMClassification 的贡献,请参考 [贡献指南](https://mmclassification.readthedocs.io/zh_CN/latest/community/CONTRIBUTING.html) 来了解如何参与贡献。 ## 致谢 @@ -126,6 +129,9 @@ MMClassification 是一款由不同学校和公司共同贡献的开源项目。 - [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab 光流估计工具箱与测试基准 - [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab 少样本学习工具箱与测试基准 - [MMHuman3D](https://github.com/open-mmlab/mmhuman3d):OpenMMLab 人体参数化模型工具箱与测试基准 +- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab 自监督学习工具箱与测试基准 +- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab 模型压缩工具箱与测试基准 +- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab 模型部署框架 ## 欢迎加入 OpenMMLab 社区 diff --git a/docs/en/install.md b/docs/en/install.md index 57ec96a1b63..a41d7cc9464 100644 --- a/docs/en/install.md +++ b/docs/en/install.md @@ -10,8 +10,8 @@ The compatible MMClassification and MMCV versions are as below. Please install t | MMClassification version | MMCV version | |:------------------------:|:---------------------:| -| master | mmcv>=1.3.16, <=1.5.0 | -| 0.19.0 | mmcv>=1.3.16, <=1.5.0 | +| dev | mmcv>=1.3.16, <=1.5.0 | +| 0.19.0 (master) | mmcv>=1.3.16, <=1.5.0 | | 0.18.0 | mmcv>=1.3.16, <=1.5.0 | | 0.17.0 | mmcv>=1.3.8, <=1.5.0 | | 0.16.0 | mmcv>=1.3.8, <=1.5.0 | @@ -29,92 +29,117 @@ The compatible MMClassification and MMCV versions are as below. Please install t | 0.6.0 | mmcv>=1.1.4 | ```{note} -Since the `master` branch is under frequent development, the `mmcv` +Since the `dev` branch is under frequent development, the `mmcv` version dependency may be inaccurate. If you encounter problems when using -the `master` branch, please try to update `mmcv` to the latest version. +the `dev` branch, please try to update `mmcv` to the latest version. ``` -## Install MMClassification +## Install Dependencies -a. Create a conda virtual environment and activate it. +1. Create a conda virtual environment and activate it. -```shell -conda create -n open-mmlab python=3.8 -y -conda activate open-mmlab -``` + ```shell + conda create -n open-mmlab python=3.8 -y + conda activate open-mmlab + ``` -b. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g., +2. Install PyTorch and torchvision following the [official instructions](https://pytorch.org/), e.g., -```shell -conda install pytorch torchvision -c pytorch -``` + ```shell + conda install pytorch torchvision -c pytorch + ``` -```{note} -Make sure that your compilation CUDA version and runtime CUDA version match. -You can check the supported CUDA version for precompiled packages on the -[PyTorch website](https://pytorch.org/). -``` + ```{note} + Make sure that your compilation CUDA version and runtime CUDA version match. + You can check the supported CUDA version for precompiled packages on the + [PyTorch website](https://pytorch.org/). + ``` -`E.g.1` If you have CUDA 10.1 installed under `/usr/local/cuda` and would like to install -PyTorch 1.5.1, you need to install the prebuilt PyTorch with CUDA 10.1. + *E.g.1* If you have CUDA 10.1 installed under `/usr/local/cuda` and would like to install + PyTorch 1.5.1, you need to install the prebuilt PyTorch with CUDA 10.1. -```shell -conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch -``` + ```shell + conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch + ``` -`E.g.2` If you have CUDA 11.3 installed under `/usr/local/cuda` and would like to install -PyTorch 1.10.0., you need to install the prebuilt PyTorch with CUDA 11.3. + *E.g.2* If you have CUDA 11.3 installed under `/usr/local/cuda` and would like to install + PyTorch 1.10.1, you need to install the prebuilt PyTorch with CUDA 11.3. -```shell -conda install pytorch==1.10.0 torchvision==0.11.1 cudatoolkit=11.3 -c pytorch -``` + ```shell + conda install pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3 -c pytorch + ``` -If you build PyTorch from source instead of installing the prebuilt package, -you can use more CUDA versions such as 9.0. + If you build PyTorch from source instead of installing the prebuilt package, + you can use more CUDA versions such as 9.0. -c. Install MMClassification repository. +3. Install MMCV -### Release version + MMCV is a foundational library for MMClassification. And there are two versions of MMCV. -We recommend you to install MMClassification with [MIM](https://github.com/open-mmlab/mim). + - **mmcv**: lite, without CUDA ops but all other features, similar to mmcv<1.0.0. It is useful when you do not need those CUDA ops. + - **mmcv-full**: comprehensive, with full features and various CUDA ops out of box. It takes longer time to build. -```shell -pip install git+https://github.com/open-mmlab/mim.git -mim install mmcls -``` + If you want to install mmcv-full, you can install/compile it according to the [instructions](https://mmcv.readthedocs.io/en/latest/get_started/installation.html). -MIM can automatically install OpenMMLab projects and their requirements, -and it can also help us to train, parameter search and pretrain model download. + A better choice is to use [MIM](https://github.com/open-mmlab/mim) to automatically select the mmcv-full version. MIM will automatically install mmcv-full when you use it to install MMClassification in the next section. -Or, you can install MMClassification with pip: + ```shell + pip install openmim + ``` -```shell -pip install mmcls -``` +## Install MMClassification repository -### Develop version +According to your needs, we support two install modes. -First, clone the MMClassification repository. +- [Use as a Python package](#use-as-a-python-package): In this mode, you just want to call MMClassification's APIs or import MMClassification's modules in your project. +- [Develop based on MMClassification (Recommended)](#develop-based-on-mmclassification): In this mode, you want to develop your own image classification task or new features based on MMClassification framework. For example, you want to add new dataset or new models. And you can use all tools we provided. -```shell -git clone https://github.com/open-mmlab/mmclassification.git -cd mmclassification -``` +### Use as a Python package -And then, install build requirements and install MMClassification. +If you have installed MIM, simply use `mim install mmcls` to install +MMClassification. MIM will automatically install the mmcv-full which fits your +environment. In addition, MIM also has some other functions to help to do +training, parameter searching and model filtering, etc. -```shell -pip install -e . # or "python setup.py develop" -``` +Or, you can use pip to install MMClassification with `pip install mmcls`. In +this situation, if you want to use mmcv-full, please install it manually in +advance. -```{note} -Following above instructions, MMClassification is installed on `dev` mode, -any local modifications made to the code will take effect without the need to -reinstall it (unless you submit some commits and want to update the version -number). -``` +### Develop based on MMClassification + +In this mode, any local modifications made to the code will take effect without +the need to reinstall it (unless you submit some commits and want to update the +version number). + +1. Clone the MMClassification repository. + + ```shell + git clone https://github.com/open-mmlab/mmclassification.git + cd mmclassification + ``` + +2. [Optional] Checkout to the `dev` branch. + + ```shell + git checkout dev + ``` + + *Do I need to do this?* The `dev` branch is in development and includes some experimental functions. If you want these functions or want to contribute to MMClassification, do it. + +3. Install requirements and MMClassification. + + Use MIM, and MIM will automatically install the mmcv-full which fits your environment. + ```shell + mim install -e . + ``` + + Or use pip, and if you want to use mmcv-full, you need to install it manually in advance. + + ```shell + pip install -e . + ``` -### Another option: Docker Image +## Another option: Docker Image We provide a [Dockerfile](https://github.com/open-mmlab/mmclassification/blob/master/docker/Dockerfile) to build an image. diff --git a/docs/zh_CN/install.md b/docs/zh_CN/install.md index 86e28548c13..4754f9bb986 100644 --- a/docs/zh_CN/install.md +++ b/docs/zh_CN/install.md @@ -10,8 +10,8 @@ MMClassification 和 MMCV 的适配关系如下,请安装正确版本的 MMCV | MMClassification 版本 | MMCV 版本 | |:---------------------:|:---------------------:| -| master | mmcv>=1.3.16, <=1.5.0 | -| 0.19.0 | mmcv>=1.3.16, <=1.5.0 | +| dev | mmcv>=1.3.16, <=1.5.0 | +| 0.19.0 (master)| mmcv>=1.3.16, <=1.5.0 | | 0.18.0 | mmcv>=1.3.16, <=1.5.0 | | 0.17.0 | mmcv>=1.3.8, <=1.5.0 | | 0.16.0 | mmcv>=1.3.8, <=1.5.0 | @@ -28,85 +28,108 @@ MMClassification 和 MMCV 的适配关系如下,请安装正确版本的 MMCV | 0.6.0 | mmcv>=1.1.4 | ```{note} -由于 `master` 分支处于频繁开发中,`mmcv` 版本依赖可能不准确。如果您在使用 -`master` 分支时遇到问题,请尝试更新 `mmcv` 到最新版。 +由于 `dev` 分支处于频繁开发中,`mmcv` 版本依赖可能不准确。如果您在使用 +`dev` 分支时遇到问题,请尝试更新 `mmcv` 到最新版。 ``` -## 安装 MMClassification 步骤 +## 安装依赖环境 -a. 创建 conda 虚拟环境,并激活 +1. 创建 conda 虚拟环境,并激活 -```shell -conda create -n open-mmlab python=3.8 -y -conda activate open-mmlab -``` + ```shell + conda create -n open-mmlab python=3.8 -y + conda activate open-mmlab + ``` -b. 按照 [官方指南](https://pytorch.org/) 安装 PyTorch 和 TorchVision,如: +2. 按照 [官方指南](https://pytorch.org/) 安装 PyTorch 和 TorchVision,如: -```shell -conda install pytorch torchvision -c pytorch -``` + ```shell + conda install pytorch torchvision -c pytorch + ``` -```{note} -请确保 CUDA 编译版本和运行版本相匹配。 -可以参照 [PyTorch 官网](https://pytorch.org/) 对预编译包所支持的 CUDA 版本进行核对。 -``` + ```{note} + 请确保 CUDA 编译版本和运行版本相匹配。 + 可以参照 [PyTorch 官网](https://pytorch.org/) 对预编译包所支持的 CUDA 版本进行核对。 + ``` -`例 1`:如果用户的 `/usr/local/cuda` 文件夹下已安装 CUDA 10.1 版本,并且想要安装 PyTorch 1.5.1 版本, -则需要安装 CUDA 10.1 下预编译的 PyTorch。 + *例 1*:如果你已经安装了 CUDA 10.1 版本,并且想要安装 PyTorch 1.5.1 版本, + 则需要安装 CUDA 10.1 下预编译的 PyTorch。 -```shell -conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch -``` + ```shell + conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.1 -c pytorch + ``` -`例 2`:如果用户的 `/usr/local/cuda` 文件夹下已安装 CUDA 11.3 版本,并且想要安装 PyTorch 1.10.0 版本, -则需要安装 CUDA 11.3 下预编译的 PyTorch。 + *例 2*:如果你已经安装了 CUDA 11.3 版本,并且想要安装 PyTorch 1.10.1 版本, + 则需要安装 CUDA 11.3 下预编译的 PyTorch。 -```shell -conda install pytorch==1.10.0 torchvision==0.11.1 cudatoolkit=11.3 -c pytorch -``` + ```shell + conda install pytorch==1.10.1 torchvision==0.11.2 cudatoolkit=11.3 -c pytorch + ``` -如果 PyTorch 是由源码进行编译安装(而非直接下载预编译好的安装包),则可以使用更多的 CUDA 版本(如 9.0 版本)。 + 如果 PyTorch 是由源码进行编译安装(而非直接下载预编译好的安装包),则可以使用更多的 CUDA 版本(如 9.0 版本)。 -c. 安装 MMClassification 库 +3. 安装 MMCV -### 稳定版本 + MMCV 是 MMClassification 的基础库。它有两个版本: -我们推荐使用 [MIM](https://github.com/open-mmlab/mim) 进行 MMClassification 的安装。 + - **mmcv**:精简版,不包含 CUDA 算子但包含其余所有特性和功能,类似 MMCV 1.0 之前的版本。如果你不需要使用 CUDA 算子的话,精简版可以作为一个考虑选项。 + - **mmcv-full**:完整版,包含所有的特性以及丰富的开箱即用的 CUDA 算子。注意完整版本可能需要更长时间来编译。 -```shell -pip install git+https://github.com/open-mmlab/mim.git -mim install mmcls -``` + 如果你希望安装 mmcv-full,你可以根据 [该教程](https://mmcv.readthedocs.io/en/latest/get_started/installation.html) 完成安装或编译。 -MIM 工具可以自动安装 OpenMMLab 旗下的各个项目及其依赖,同时可以协助进行训练、调参和预训练模型下载等。 + 一个更好的选择是使用 [MIM](https://github.com/open-mmlab/mim) 来自动选择适合你的 mmcv-full 版本。在使用 MIM 安装 MMClassification 的时候,它就会自动完成 mmcv-full 的安装。 -或者,可以直接通过 pip 进行 MMClassification 的安装: + ```shell + pip install openmim + ``` -```shell -pip install mmcls -``` +## 安装 MMClassification 库 -### 开发版本 +根据你的需求,我们支持两种安装模式。 -首先,克隆最新的 MMClassification 仓库: +- [仅作为 Python 包使用](#仅作为-python-包使用):该模式下,你只希望在你的项目中调用 MMClassification 的 API,或者导入 MMClassification 中的模块 +- [基于 MMClassification 进行开发(推荐)](#基于-mmclassification-进行开发):该模式下,你希望基于 MMClassification 框架开发你自己的图像分类任务,需要添加新的功能,比如新的模型或是数据集。并且你可以使用我们提供的所有工具。 -```shell -git clone https://github.com/open-mmlab/mmclassification.git -cd mmclassification -``` +### 仅作为 Python 包使用 -之后,安装依赖包和 MMClassification: +如果你已经安装了 MIM,那么只需要使用 `mim install mmcls` 命令来安装 MMClassification。MIM 将会根据你的环境选择安装合适的 mmcv-full 版本。另外,MIM 还提供了一系列其他功能来协助进行训练、参数搜索及模型筛选等。 -```shell -pip install -e . # 或者 "python setup.py develop" -``` +或者,你可以直接通过 pip 来安装,使用 `pip install mmcls` 命令。这种情况下,如果你希望使用 mmcv-full,那么需要提前手动安装 mmcv-full。 -```{note} -按照以上步骤,MMClassification 是以 `dev` 模式安装的,任何本地的代码修改都可以直接生效,无需重新安装(除非提交了一些 commit,并且希望提升版本号) -``` +### 基于 MMClassification 进行开发 + +在该模式下,任何本地修改都会直接生效,不需要重新安装(除非提交了一些 commit,并且希望提升版本号)。 + +1. 克隆最新的 MMClassification 仓库 + + ```shell + git clone https://github.com/open-mmlab/mmclassification.git + cd mmclassification + ``` + +2. [可选] 签出到 `dev` 分支 + + ```shell + git checkout dev + ``` + + *我需要做这一步吗?* `dev` 分支是开发中的分支,包含了一些试验性的功能。如果你需要这些功能,或者准备参与 MMClassification 开发,那么需要做这一步。 + +2. 安装依赖包和 MMClassification + + 使用 MIM,MIM 会自动安装适合你环境的 mmcv-full。 + + ```shell + mim install -e . + ``` + + 或者使用 pip,如果你希望使用 mmcv-full,你需要提前手动安装。 + + ```shell + pip install -e . + ``` -### 利用 Docker 镜像安装 MMClassification +## 利用 Docker 镜像安装 MMClassification MMClassification 提供 [Dockerfile](https://github.com/open-mmlab/mmclassification/blob/master/docker/Dockerfile) ,可以通过以下命令创建 docker 镜像。