Skip to content

Commit 14f6ec5

Browse files
authored
[Doc] Update faq and installation doc (open-mmlab#1653)
* update faq and install doc * add more explanation * add logfile faq * add output image command * update Chinese version doc * minor change
1 parent 5fc7c5c commit 14f6ec5

File tree

3 files changed

+201
-165
lines changed

3 files changed

+201
-165
lines changed

docs/en/faq.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ The compatible MMSegmentation and MMCV versions are as below. Please install the
3131
| 0.7.0 | mmcv-full>=1.1.2, \<1.2.0 | Not required |
3232
| 0.6.0 | mmcv-full>=1.1.2, \<1.2.0 | Not required |
3333

34-
:::{note}
3534
You need to run `pip uninstall mmcv` first if you have mmcv installed.
3635
If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.
37-
:::
3836

3937
- "No module named 'mmcv.ops'"; "No module named 'mmcv.\_ext'".
4038

@@ -45,3 +43,22 @@ If mmcv and mmcv-full are both installed, there will be `ModuleNotFoundError`.
4543

4644
- Infer from the name of the config file of the model. You can refer to the `Config Name Style` part of [Learn about Configs](https://github.com/open-mmlab/mmsegmentation/blob/master/docs/en/tutorials/config.md). For example, for config file with name `segformer_mit-b0_8x1_1024x1024_160k_cityscapes.py`, `8x1` means training the model corresponding to it needs 8 GPUs, and the batch size of each GPU is 1.
4745
- Infer from the log file. Open the log file of the model and search `nGPU` in the file. The number of figures following `nGPU` is the number of GPUs needed to train the model. For instance, searching for `nGPU` in the log file yields the record `nGPU 0,1,2,3,4,5,6,7`, which indicates that eight GPUs are needed to train the model.
46+
47+
## What does the auxiliary head mean
48+
49+
Briefly, it is a deep supervision trick to improve the accuracy. In the training phase, `decode_head` is for decoding semantic segmentation output, `auxiliary_head` is just adding an auxiliary loss, the segmentation result produced by it has no impact to your model's result, it just works in training. You may read this [paper](https://arxiv.org/pdf/1612.01105.pdf) for more information.
50+
51+
## Why is the log file not created
52+
53+
In the train script, we call `get_root_logger`at Line 167, and `get_root_logger` in mmseg calls `get_logger` in mmcv, mmcv will return the same logger which has beed initialized in 'mmsegmentation/tools/train.py' with the parameter `log_file`. There is only one logger (initialized with `log_file`) during training.
54+
Ref: [https://github.com/open-mmlab/mmcv/blob/21bada32560c7ed7b15b017dc763d862789e29a8/mmcv/utils/logging.py#L9-L16](https://github.com/open-mmlab/mmcv/blob/21bada32560c7ed7b15b017dc763d862789e29a8/mmcv/utils/logging.py#L9-L16)
55+
56+
If you find the log file not been created, you might check if `mmcv.utils.get_logger` is called elsewhere.
57+
58+
## How to output the image for painting the segmentation mask when running the test script
59+
60+
In the test script, we provide `show-dir` argument to control whether output the painted images. Users might run the following command:
61+
62+
```shell
63+
python tools/test.py {config} {checkpoint} --show-dir {/path/to/save/image} --opacity 1
64+
```

docs/zh_cn/faq.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,63 @@
22

33
我们在这里列出了使用时的一些常见问题及其相应的解决方案。 如果您发现有一些问题被遗漏,请随时提 PR 丰富这个列表。 如果您无法在此获得帮助,请使用 [issue模板](https://github.com/open-mmlab/mmsegmentation/blob/master/.github/ISSUE_TEMPLATE/error-report.md/)创建问题,但是请在模板中填写所有必填信息,这有助于我们更快定位问题。
44

5+
## 安装
6+
7+
兼容的MMSegmentation和MMCV版本如下。请安装正确版本的MMCV以避免安装问题。
8+
9+
| MMSegmentation version | MMCV version | MMClassification version |
10+
| :--------------------: | :-------------------------: | :----------------------: |
11+
| master | mmcv-full>=1.5.0, \<=1.6.0 | mmcls>=0.20.1, \<=1.0.0 |
12+
| 0.25.0 | mmcv-full>=1.5.0, \<=1.6.0 | mmcls>=0.20.1, \<=1.0.0 |
13+
| 0.24.1 | mmcv-full>=1.4.4, \<=1.6.0 | mmcls>=0.20.1, \<=1.0.0 |
14+
| 0.23.0 | mmcv-full>=1.4.4, \<=1.6.0 | mmcls>=0.20.1, \<=1.0.0 |
15+
| 0.22.0 | mmcv-full>=1.4.4, \<=1.6.0 | mmcls>=0.20.1, \<=1.0.0 |
16+
| 0.21.1 | mmcv-full>=1.4.4, \<=1.6.0 | Not required |
17+
| 0.20.2 | mmcv-full>=1.3.13, \<=1.6.0 | Not required |
18+
| 0.19.0 | mmcv-full>=1.3.13, \<1.3.17 | Not required |
19+
| 0.18.0 | mmcv-full>=1.3.13, \<1.3.17 | Not required |
20+
| 0.17.0 | mmcv-full>=1.3.7, \<1.3.17 | Not required |
21+
| 0.16.0 | mmcv-full>=1.3.7, \<1.3.17 | Not required |
22+
| 0.15.0 | mmcv-full>=1.3.7, \<1.3.17 | Not required |
23+
| 0.14.1 | mmcv-full>=1.3.7, \<1.3.17 | Not required |
24+
| 0.14.0 | mmcv-full>=1.3.1, \<1.3.2 | Not required |
25+
| 0.13.0 | mmcv-full>=1.3.1, \<1.3.2 | Not required |
26+
| 0.12.0 | mmcv-full>=1.1.4, \<1.3.2 | Not required |
27+
| 0.11.0 | mmcv-full>=1.1.4, \<1.3.0 | Not required |
28+
| 0.10.0 | mmcv-full>=1.1.4, \<1.3.0 | Not required |
29+
| 0.9.0 | mmcv-full>=1.1.4, \<1.3.0 | Not required |
30+
| 0.8.0 | mmcv-full>=1.1.4, \<1.2.0 | Not required |
31+
| 0.7.0 | mmcv-full>=1.1.2, \<1.2.0 | Not required |
32+
| 0.6.0 | mmcv-full>=1.1.2, \<1.2.0 | Not required |
33+
34+
如果你安装了mmcv,你需要先运行`pip uninstall mmcv`
35+
如果mmcv和mmcv-full都安装了,会出现 "ModuleNotFoundError"。
36+
37+
- "No module named 'mmcv.ops'"; "No module named 'mmcv.\_ext'".
38+
1. 使用`pip uninstall mmcv`卸载环境中现有的mmcv。
39+
2. 按照[安装说明](get_started#best-practices)安装mmcv-full。
40+
541
## 如何获知模型训练时需要的显卡数量
642

743
- 看模型的config文件的命名。可以参考[学习配置文件](https://github.com/open-mmlab/mmsegmentation/blob/master/docs/zh_cn/tutorials/config.md)中的`配置文件命名风格`部分。比如,对于名字为`segformer_mit-b0_8x1_1024x1024_160k_cityscapes.py`的config文件,`8x1`代表训练其对应的模型需要的卡数为8,每张卡中的batch size为1。
844
- 看模型的log文件。点开该模型的log文件,并在其中搜索`nGPU`,在`nGPU`后的数字个数即训练时所需的卡数。比如,在log文件中搜索`nGPU`得到`nGPU 0,1,2,3,4,5,6,7`的记录,则说明训练该模型需要使用八张卡。
45+
46+
## auxiliary head 是什么
47+
48+
简单来说,这是一个提高准确率的深度监督技术。在训练阶段,`decode_head` 用于输出语义分割的结果,`auxiliary_head` 只是增加了一个辅助损失,其产生的分割结果对你的模型结果没有影响,仅在在训练中起作用。你可以阅读这篇[论文](https://arxiv.org/pdf/1612.01105.pdf)了解更多信息。
49+
50+
## 为什么日志文件没有被创建
51+
52+
在训练脚本中,我们在第167行调用 `get_root_logger` 方法,然后 mmseg 的 `get_root_logger` 方法调用 mmcv 的 `get_logger`,mmcv 将返回在 'mmsegmentation/tools/train.py' 中使用参数 `log_file` 初始化的同一个 logger。在训练期间只存在一个用 `log_file` 初始化的 logger。
53+
54+
参考:[https://github.com/open-mmlab/mmcv/blob/21bada32560c7ed7b15b017dc763d862789e29a8/mmcv/utils/logging.py#L9-L16](https://github.com/open-mmlab/mmcv/blob/21bada32560c7ed7b15b017dc763d862789e29a8/mmcv/utils/logging.py#L9-L16)
55+
56+
如果你发现日志文件没有被创建,可以检查 `mmcv.utils.get_logger` 是否在其他地方被调用。
57+
58+
## 运行测试脚本时如何输出绘制分割掩膜的图像
59+
60+
在测试脚本中,我们提供了`show-dir`参数来控制是否输出绘制的图像。用户可以运行以下命令:
61+
62+
```shell
63+
python tools/test.py {config} {checkpoint} --show-dir {/path/to/save/image} --opacity 1
64+
```

0 commit comments

Comments
 (0)