Skip to content

Commit

Permalink
Refine doc (open-mmlab#3388)
Browse files Browse the repository at this point in the history
* Refine docs and fix format issues

* reformat

* fix mock

* Refine format

* Reorganize tutorials

* Update install doc

* resolve comments
  • Loading branch information
ZwwWayne authored Jul 24, 2020
1 parent 963cc00 commit 352cf7f
Showing 1 changed file with 54 additions and 6 deletions.
60 changes: 54 additions & 6 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- GCC 5+
- [mmcv](https://github.com/open-mmlab/mmcv)


### Install mmdetection

a. Create a conda virtual environment and activate it.
Expand Down Expand Up @@ -54,17 +53,33 @@ pip install mmcv-full==latest+torch1.5.0+cu101 -f https://openmmlab.oss-accelera
See [here]((https://github.com/open-mmlab/mmcv#install-with-pip)) for different versions of MMCV compatible to different PyTorch and CUDA versions.
Optionally you can choose to compile mmcv from source by the following command

```
```shell
git clone https://github.com/open-mmlab/mmcv.git
cd mmcv
MMCV_WITH_OPS=1 pip install -e . # package mmcv-full will be installed after this step
cd ..
```

Or directly run
```python

```shell
pip install mmcv-full
```
**Important**: You need to run `pip unisntall mmcv` first if you have mmcv installed.

**Important**:

1. The required versions of MMCV for different versions of MMDetection since V2.0 are as below. Please install the correct version of MMCV to avoid installation issues.

| MMDetection version | MMCV version |
|:-------------------:|:-------------------:|
| master | mmcv-full>=1.0.2 |
| 2.3.0rc0 | mmcv-full>=1.0.2 |
| 2.2.1 | mmcv==0.6.2 |
| 2.2.0 | mmcv==0.6.2 |
| 2.1.0 | mmcv>=0.5.9, <=0.6.1|
| 2.0.0 | mmcv>=0.5.1, <=0.5.8|

2. You need to run `pip unisntall mmcv` first if you have mmcv installed.
If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.

d. Clone the mmdetection repository.
Expand All @@ -85,7 +100,7 @@ pip install -v -e . # or "python setup.py develop"

If you build mmdetection on macOS, replace the last command with

```
```shell
CC=clang CXX=clang++ CFLAGS='-stdlib=libc++' pip install -e .
```

Expand All @@ -96,7 +111,7 @@ It is recommended that you run step d each time you pull some updates from githu

> Important: Be sure to remove the `./build` folder if you reinstall mmdet with a different CUDA/PyTorch version.

```
```shell
pip uninstall mmdet
rm -rf ./build
find . -name "*.so" | xargs rm
Expand All @@ -110,6 +125,7 @@ you can install it before installing MMCV.
4. Some dependencies are optional. Simply running `pip install -v -e .` will only install the minimum runtime requirements. To use optional dependencies like `albumentations` and `imagecorruptions` either install them manually with `pip install -r requirements/optional.txt` or specify desired extras when calling `pip` (e.g. `pip install -v -e .[optional]`). Valid keys for the extras field are: `all`, `tests`, `build`, and `optional`.

### Install with CPU only

The code can be built for CPU only environment (where CUDA isn't available).

In CPU mode you can run the demo/webcam_demo.py for example.
Expand Down Expand Up @@ -169,3 +185,35 @@ To use the default MMDetection installed in the environment rather than that you
```shell
PYTHONPATH="$(dirname $0)/..":$PYTHONPATH
```

### Common issues

We list some common issues and their corresponding solutions here. Feel free to enrich the list if you find any frequent issues and have ways to help others to solve them.

<details>
<summary>
Compatibility issue between MMCV and MMDetection; "ConvWS is already registered in conv layer";
</summary>
Please install the correct version of MMCV for the version of your MMDetection following the instruction above.
</details>

<details>
<summary>
"No module named 'mmcv.ops'"; "No module named 'mmcv._ext'".
</summary>

1. Uninstall existing mmcv in the environment using `pip uninstall mmcv`.
2. Install mmcv-full following the instruction above.

</details>

<details>
<summary>
"invalid device function" or "no kernel image is available for execution".
</summary>

1. Check the CUDA compute capability of you GPU.
2. Run `python mmdet/utils/collect_env.py` to check whether PyTorch, torchvision, and MMCV are built for the correct GPU architecture. You may need to set `TORCH_CUDA_ARCH_LIST` to reinstall MMCV. The compatibility issue could happen when using old GPUS, e.g., Tesla K80 (3.7) on colab.
3. Check whether the running environment is the same as that when mmcv/mmdet is compiled. For example, you may compile mmcv using CUDA 10.0 bug run it on CUDA9.0 environments.

</details>

0 comments on commit 352cf7f

Please sign in to comment.