Skip to content

Commit cb3e694

Browse files
authored
[Doc] Rewrite the installation guide (#7897)
* rewrite the installation guide * move installation trouble shooting to the FAQ page * fix typo * fix the config file path in the demo codes * minor rephrases * minor update of the doc format * typo fix * update fap link * fix a typo * update config to fix the error with anchors
1 parent d7734dd commit cb3e694

File tree

3 files changed

+200
-181
lines changed

3 files changed

+200
-181
lines changed

docs/en/conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def get_version():
4949
'sphinx_copybutton',
5050
]
5151

52+
myst_enable_extensions = ['colon_fence']
53+
myst_heading_anchors = 3
54+
5255
autodoc_mock_imports = [
5356
'matplotlib', 'pycocotools', 'terminaltables', 'mmdet.version', 'mmcv.ops'
5457
]

docs/en/faq.md

+76-6
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,86 @@
22

33
We list some common troubles faced by many users 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. If the contents here do not cover your issue, please create an issue using the [provided templates](https://github.com/open-mmlab/mmdetection/blob/master/.github/ISSUE_TEMPLATE/error-report.md/) and make sure you fill in all required information in the template.
44

5-
## MMCV Installation
5+
## Installation
66

77
- Compatibility issue between MMCV and MMDetection; "ConvWS is already registered in conv layer"; "AssertionError: MMCV==xxx is used but incompatible. Please install mmcv>=xxx, <=xxx."
88

9-
Please install the correct version of MMCV for the version of your MMDetection following the [installation instruction](https://mmdetection.readthedocs.io/en/latest/get_started.html#installation).
9+
Compatible MMDetection and MMCV versions are shown as below. Please choose the correct version of MMCV to avoid installation issues.
10+
11+
| MMDetection version | MMCV version |
12+
|:-------------------:|:-------------------------:|
13+
| master | mmcv-full>=1.3.17, <1.6.0 |
14+
| 2.24.0 | mmcv-full>=1.3.17, <1.6.0 |
15+
| 2.23.0 | mmcv-full>=1.3.17, <1.5.0 |
16+
| 2.22.0 | mmcv-full>=1.3.17, <1.5.0 |
17+
| 2.21.0 | mmcv-full>=1.3.17, <1.5.0 |
18+
| 2.20.0 | mmcv-full>=1.3.17, <1.5.0 |
19+
| 2.19.1 | mmcv-full>=1.3.17, <1.5.0 |
20+
| 2.19.0 | mmcv-full>=1.3.17, <1.5.0 |
21+
| 2.18.0 | mmcv-full>=1.3.17, <1.4.0 |
22+
| 2.17.0 | mmcv-full>=1.3.14, <1.4.0 |
23+
| 2.16.0 | mmcv-full>=1.3.8, <1.4.0 |
24+
| 2.15.1 | mmcv-full>=1.3.8, <1.4.0 |
25+
| 2.15.0 | mmcv-full>=1.3.8, <1.4.0 |
26+
| 2.14.0 | mmcv-full>=1.3.8, <1.4.0 |
27+
| 2.13.0 | mmcv-full>=1.3.3, <1.4.0 |
28+
| 2.12.0 | mmcv-full>=1.3.3, <1.4.0 |
29+
| 2.11.0 | mmcv-full>=1.2.4, <1.4.0 |
30+
| 2.10.0 | mmcv-full>=1.2.4, <1.4.0 |
31+
| 2.9.0 | mmcv-full>=1.2.4, <1.4.0 |
32+
| 2.8.0 | mmcv-full>=1.2.4, <1.4.0 |
33+
| 2.7.0 | mmcv-full>=1.1.5, <1.4.0 |
34+
| 2.6.0 | mmcv-full>=1.1.5, <1.4.0 |
35+
| 2.5.0 | mmcv-full>=1.1.5, <1.4.0 |
36+
| 2.4.0 | mmcv-full>=1.1.1, <1.4.0 |
37+
| 2.3.0 | mmcv-full==1.0.5 |
38+
| 2.3.0rc0 | mmcv-full>=1.0.2 |
39+
| 2.2.1 | mmcv==0.6.2 |
40+
| 2.2.0 | mmcv==0.6.2 |
41+
| 2.1.0 | mmcv>=0.5.9, <=0.6.1 |
42+
| 2.0.0 | mmcv>=0.5.1, <=0.5.8 |
1043

1144
- "No module named 'mmcv.ops'"; "No module named 'mmcv._ext'".
1245

1346
1. Uninstall existing mmcv in the environment using `pip uninstall mmcv`.
14-
2. Install mmcv-full following the [installation instruction](https://mmcv.readthedocs.io/en/latest/#installation).
47+
2. Install mmcv-full following the [installation instruction](get_started#best-practices).
48+
49+
- Using albumentations
50+
51+
If you would like to use `albumentations`, we suggest using `pip install -r requirements/albu.txt` or
52+
`pip install -U albumentations --no-binary qudida,albumentations`.
53+
If you simply use `pip install albumentations>=0.3.2`, it will install `opencv-python-headless` simultaneously (even though you have already installed `opencv-python`).
54+
Please refer to the [official documentation](https://albumentations.ai/docs/getting_started/installation/#note-on-opencv-dependencies) for details.
55+
56+
- ModuleNotFoundError is raised when using some algorithms
57+
58+
Some extra dependencies are required for Instaboost, Panoptic Segmentation, LVIS dataset, etc. Please note the error message and install corresponding packages, e.g.,
59+
60+
```shell
61+
# for instaboost
62+
pip install instaboostfast
63+
# for panoptic segmentation
64+
pip install git+https://github.com/cocodataset/panopticapi.git
65+
# for LVIS dataset
66+
pip install git+https://github.com/lvis-dataset/lvis-api.git
67+
```
68+
69+
## Coding
70+
71+
- Do I need to reinstall mmdet after some code modifications
72+
73+
If you follow the best practice and install mmdet with `pip install -e .`, any local modifications made to the code will take effect without reinstallation.
74+
75+
- How to develop with multiple MMDetection versions
76+
77+
You can have multiple folders like mmdet-2.21, mmdet-2.22.
78+
When you run the train or test script, it will adopt the mmdet package in the current folder.
79+
80+
To use the default MMDetection installed in the environment rather than the one you are working with, you can remove the following line in those scripts:
81+
82+
```shell
83+
PYTHONPATH="$(dirname $0)/..":$PYTHONPATH
84+
```
1585

1686
## PyTorch/CUDA Environment
1787

@@ -82,7 +152,7 @@ We list some common troubles faced by many users and their corresponding solutio
82152

83153
- "RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one"
84154
1. This error indicates that your module has parameters that were not used in producing loss. This phenomenon may be caused by running different branches in your code in DDP mode.
85-
2. You can set ` find_unused_parameters = True` in the config to solve the above problems(but this will slow down the training speed.
155+
2. You can set `find_unused_parameters = True` in the config to solve the above problems(but this will slow down the training speed.
86156
3. If the version of your MMCV >= 1.4.1, you can get the name of those unused parameters with `detect_anomalous_params=True` in `optimizer_config` of config.
87157

88158
- Save the best model
@@ -91,7 +161,7 @@ We list some common troubles faced by many users and their corresponding solutio
91161

92162
- Resume training with `ExpMomentumEMAHook`
93163

94-
If you use `ExpMomentumEMAHook` in training, you can't just use command line parameters `--resume-from` nor `--cfg-options resume_from` to restore model parameters during resume, i.e., the command `python tools/train.py configs/yolox/yolox_s_8x8_300e_coco.py --resume-from ./work_dir/yolox_s_8x8_300e_coco/epoch_x.pth ` will not work. Since `ExpMomentumEMAHook` needs to reload the weights, taking the `yolox_s` algorithm as an example, you should modify the values of `resume_from` in two places of the config as below:
164+
If you use `ExpMomentumEMAHook` in training, you can't just use command line parameters `--resume-from` nor `--cfg-options resume_from` to restore model parameters during resume, i.e., the command `python tools/train.py configs/yolox/yolox_s_8x8_300e_coco.py --resume-from ./work_dir/yolox_s_8x8_300e_coco/epoch_x.pth` will not work. Since `ExpMomentumEMAHook` needs to reload the weights, taking the `yolox_s` algorithm as an example, you should modify the values of `resume_from` in two places of the config as below:
95165
96166
```python
97167
# Open configs/yolox/yolox_s_8x8_300e_coco.py directly and modify all resume_from fields
@@ -130,6 +200,6 @@ We list some common troubles faced by many users and their corresponding solutio
130200
131201
ResNeXt comes from the paper [`Aggregated Residual Transformations for Deep Neural Networks`](https://arxiv.org/abs/1611.05431). It introduces group and uses “cardinality” to control the number of groups to achieve a balance between accuracy and complexity. It controls the basic width and grouping parameters of the internal Bottleneck module through two hyperparameters `baseWidth` and `cardinality`. An example configuration name in MMDetection is `mask_rcnn_x101_64x4d_fpn_mstrain-poly_3x_coco.py`, where `mask_rcnn` represents the algorithm using Mask R-CNN, `x101` represents the backbone network using ResNeXt-101, and `64x4d` represents that the bottleneck block has 64 group and each group has basic width of 4.
132202
133-
- `norm_eval` in backbone
203+
- `norm_eval` in backbone
134204
135205
Since the detection model is usually large and the input image resolution is high, this will result in a small batch of the detection model, which will make the variance of the statistics calculated by BatchNorm during the training process very large and not as stable as the statistics obtained during the pre-training of the backbone network . Therefore, the `norm_eval=True` mode is generally used in training, and the BatchNorm statistics in the pre-trained backbone network are directly used. The few algorithms that use large batches are the `norm_eval=False` mode, such as NASFPN. For the backbone network without ImageNet pre-training and the batch is relatively small, you can consider using `SyncBN`.

0 commit comments

Comments
 (0)