Skip to content

Commit

Permalink
Update from-scratch install script in install.md (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
BIGWangYuDong committed Apr 9, 2022
1 parent 416103a commit 0bcae58
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 86 deletions.
19 changes: 0 additions & 19 deletions README.md
Expand Up @@ -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

Expand Down
20 changes: 1 addition & 19 deletions README_zh-CN.md
Expand Up @@ -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 的框架。
Expand Down
49 changes: 25 additions & 24 deletions docs/en/install.md
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
48 changes: 24 additions & 24 deletions docs/zh_cn/install.md
Expand Up @@ -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 新建虚拟环境,并进入该虚拟环境;
Expand Down Expand Up @@ -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 代码在示例图像进行推理:
Expand Down

0 comments on commit 0bcae58

Please sign in to comment.