diff --git a/README.md b/README.md index 44edd4e..784219d 100644 --- a/README.md +++ b/README.md @@ -100,26 +100,7 @@ Supported algorithms: ## Installation & Dataset Preparation MMFewShot depends on [PyTorch](https://pytorch.org/) and [MMCV](https://github.com/open-mmlab/mmcv). -Below are quick steps for installation. Please refer to [install.md](/docs/en/install.md) for installation of MMFewShot and [data preparation](tools/data/README.md) for dataset preparation. -```shell -conda create -n openmmlab python=3.7 -y -conda activate openmmlab - -conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch - -# install the latest mmcv -pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html - -# install mmclassification mmdetection -pip install mmcls mmdet - -# install mmfewshot -git clone https://github.com/open-mmlab/mmfewshot.git -cd mmfewshot -pip install -r requirements/build.txt -pip install -v -e . # or "python setup.py develop" -``` ## Getting Started diff --git a/README_zh-CN.md b/README_zh-CN.md index 6e7fbba..d078188 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -97,26 +97,8 @@ MMFewShot 是一款基于 PyTorch 的少样本学习代码库,是 [OpenMMLab]( ## 安装与准备数据集 -MMFewShot 依赖 [PyTorch](https://pytorch.org/) 和 [MMCV](https://github.com/open-mmlab/mmcv) ,以下是安装的简要步骤。 +MMFewShot 依赖 [PyTorch](https://pytorch.org/) 和 [MMCV](https://github.com/open-mmlab/mmcv) 。 请参考[安装文档](docs/zh_cn/install.md)进行安装和参考[数据准备](tools/data/README.md)准备数据集。 -```shell -conda create -n openmmlab python=3.7 -y -conda activate openmmlab - -conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch - -# install the latest mmcv -pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html - -# install mmclassification mmdetection -pip install mmcls mmdet - -# install mmfewshot -git clone https://github.com/open-mmlab/mmfewshot.git -cd mmfewshot -pip install -r requirements/build.txt -pip install -v -e . # or "python setup.py develop" -``` ## 快速入门 如果初次了解少样本学习,你可以从[基础介绍](docs/en/intro.md)开始了解少样本学习的基本概念和 MMFewShot 的框架。 diff --git a/docs/en/install.md b/docs/en/install.md index dd64845..ba1709c 100644 --- a/docs/en/install.md +++ b/docs/en/install.md @@ -21,6 +21,31 @@ If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`. ## Installation +### A from-scratch setup script + +Assuming that you already have CUDA 10.1 installed, here is a full script for setting up MMFewShot with conda. +You can refer to the step-by-step installation instructions in the next section. + +```shell +conda create -n openmmlab python=3.7 -y +conda activate openmmlab + +conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch + +pip install openmim +mim install mmcv-full + +# install mmclassification mmdetection +mim install mmcls +mim install mmdet + +# install mmfewshot +git clone https://github.com/open-mmlab/mmfewshot.git +cd mmfewshot +pip install -r requirements/build.txt +pip install -v -e . # or "python setup.py develop" +``` + ### Prepare environment 1. Create a conda virtual environment and activate it. @@ -128,30 +153,6 @@ Run it with docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmfewshot/data mmfewshot ``` -### A from-scratch setup script - -Assuming that you already have CUDA 10.1 installed, here is a full script for setting up MMDetection with conda. - -```shell -conda create -n openmmlab python=3.7 -y -conda activate openmmlab - -conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch - -# install the latest mmcv -pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html - -# install mmclassification mmdetection -pip install mmcls mmdet - -# install mmfewshot -git clone https://github.com/open-mmlab/mmfewshot.git -cd mmfewshot -pip install -r requirements/build.txt -pip install -v -e . # or "python setup.py develop" -``` - - ## Verification To verify whether MMFewShot is installed correctly, we can run the demo code and inference a demo image. diff --git a/docs/zh_cn/install.md b/docs/zh_cn/install.md index e472e3f..3eb6e44 100644 --- a/docs/zh_cn/install.md +++ b/docs/zh_cn/install.md @@ -20,6 +20,30 @@ MMFewShot 和 MMCV, MMCls, MMDet 版本兼容性如下所示,需要安装正 ## 安装流程 +### 从零开始设置脚本 + +假设当前已经成功安装 CUDA 10.1,这里提供了一个完整的基于 conda 安装 MMFewShot 的脚本。您可以参考下一节中的分步安装说明。 + +```shell +conda create -n openmmlab python=3.7 -y +conda activate openmmlab + +conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch + +pip install openmim +mim install mmcv-full + +# install mmclassification mmdetection +mim install mmcls +mim install mmdet + +# install mmfewshot +git clone https://github.com/open-mmlab/mmfewshot.git +cd mmfewshot +pip install -r requirements/build.txt +pip install -v -e . # or "python setup.py develop" +``` + ### 准备环境 1. 使用 conda 新建虚拟环境,并进入该虚拟环境; @@ -121,30 +145,6 @@ docker build -t mmfewshot docker/ docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmfewshot/data mmfewshot ``` -### 从零开始设置脚本 - -假设当前已经成功安装 CUDA 10.1,这里提供了一个完整的基于 conda 安装 MMDetection 的脚本: - -```shell -conda create -n openmmlab python=3.7 -y -conda activate openmmlab - -conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=10.1 -c pytorch - -# 安装最新版本的 mmcv -pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.7.0/index.html - -# 安装 mmclassification mmdetection -pip install mmcls mmdet - -# 安装 mmfewshot -git clone https://github.com/open-mmlab/mmfewshot.git -cd mmfewshot -pip install -r requirements/build.txt -pip install -v -e . # or "python setup.py develop" -``` - - ## 验证 为了验证是否正确安装了 MMFewShot 和所需的环境,我们可以运行示例的 Python 代码在示例图像进行推理: