Skip to content

Commit c712070

Browse files
authored
[Docs] Resolve warnings in sphinx build (#915)
* add ZeroOptimizer to optim * resolve `duplicate label` warnings * upgrade docutils && shpinx to resolve `unknown directive or role` warnings * fix typo * resolve literal_block && heading warnings * resolve json literal_block warnings * resolve python literal_block warnings * resolve bunches of reference warnings * resolve bunches of docstring warnings * resolve warnings in autosummary * resolve remaining warnings in en docs * resolve heading warnings in zh_cn docs * resolve remaining warnings in zh_cn docs * fix as comments * fix as comments
1 parent 4749682 commit c712070

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+252
-246
lines changed

docs/en/advanced_tutorials/basedataset.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,20 @@ Here is an example of a JSON annotation file (where each raw data info contains
1919
```json
2020

2121
{
22-
'metainfo':
22+
"metainfo":
2323
{
24-
'classes': ('cat', 'dog'),
25-
...
24+
"classes": ["cat", "dog"]
2625
},
27-
'data_list':
26+
"data_list":
2827
[
2928
{
30-
'img_path': "xxx/xxx_0.jpg",
31-
'img_label': 0,
32-
...
29+
"img_path": "xxx/xxx_0.jpg",
30+
"img_label": 0
3331
},
3432
{
35-
'img_path': "xxx/xxx_1.jpg",
36-
'img_label': 1,
37-
...
38-
},
39-
...
33+
"img_path": "xxx/xxx_1.jpg",
34+
"img_label": 1
35+
}
4036
]
4137
}
4238
```

docs/en/advanced_tutorials/config.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,15 +352,16 @@ optimizer:
352352
353353
`resnet50_dump.json`
354354

355-
````json
355+
```json
356356
{"optimizer": {"type": "SGD", "lr": 0.02, "momentum": 0.9, "weight_decay": 0.0001}, "model": {"type": "ResNet", "depth": 50}}
357+
```
357358

358359
In addition, `dump` can also dump `cfg` loaded from a dictionary.
359360

360361
```python
361362
cfg = Config(dict(a=1, b=2))
362363
cfg.dump('dump_dict.py')
363-
````
364+
```
364365

365366
`dump_dict.py`
366367

docs/en/advanced_tutorials/data_transform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ processed data as a dictionary. A simple example is as belows:
1515
```{note}
1616
In MMEngine, we don't have the implementations of data transforms. you can find the base data transform class
1717
and many other data transforms in MMCV. So you need to install MMCV before learning this tutorial, see the
18-
{external+mmcv:doc}`MMCV installation guild <get_started/installation>`.
18+
{external+mmcv:doc}`MMCV installation guide <get_started/installation>`.
1919
```
2020

2121
```python

docs/en/advanced_tutorials/logging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Flexible Logging System
66

7-
Logging system is configured by passing a [LogProcessor](mmengine.logging.LogProcessor) to the runner. If no log processor is passed, the runner will use the default log processor, which is equivalent to:
7+
Logging system is configured by passing a [LogProcessor](mmengine.runner.LogProcessor) to the runner. If no log processor is passed, the runner will use the default log processor, which is equivalent to:
88

99
```python
1010
log_processor = dict(window_size=10, by_epoch=True, custom_cfg=None, num_digits=4)
@@ -70,7 +70,7 @@ The significant digits(`num_digits`) of the log is 4 by default.
7070
Output the value of all custom logs at the last iteration by default.
7171
```
7272

73-
```{warnning}
73+
```{warning}
7474
log_processor outputs the epoch based log by default(`by_epoch=True`). To get an expected log matched with the `train_cfg`, we should set the same value for `by_epoch` in `train_cfg` and `log_processor`.
7575
```
7676

@@ -191,7 +191,7 @@ runner.train()
191191
08/21 03:17:26 - mmengine - INFO - Epoch(train) [1][20/25] lr: 1.0000e-02 eta: 0:00:00 time: 0.0024 data_time: 0.0010 loss1: 0.5464 loss2: 0.7251 loss: 1.2715 loss1_local_max: 2.8872 loss1_global_max: 2.8872
192192
```
193193

194-
More examples can be found in [log_processor](mmengine.logging.LogProcessor).
194+
More examples can be found in [log_processor](mmengine.runner.LogProcessor).
195195

196196
## Customize log
197197

docs/en/advanced_tutorials/registry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Registry
22

3-
OpenMMLab supports a rich collection of algorithms and datasets, therefore, many modules with similar functionality are implemented. For example, the implementations of `ResNet` and `SE-ResNet` are based on the classes `ResNet` and `SEResNet`, respectively, which have similar functions and interfaces and belong to the model components of the algorithm library. To manage these functionally similar modules, MMEngine implements the [registry](mmengine.registry.registry). Most of the algorithm libraries in OpenMMLab use `registry` to manage their modules, including [MMDetection](https://github.com/open-mmlab/mmdetection), [MMDetection3D](https://github.com/open-mmlab/mmdetection3d), [MMClassification](https://github.com/open-mmlab/mmclassification) and [MMEditing](https://github.com/open-mmlab/mmediting), etc.
3+
OpenMMLab supports a rich collection of algorithms and datasets, therefore, many modules with similar functionality are implemented. For example, the implementations of `ResNet` and `SE-ResNet` are based on the classes `ResNet` and `SEResNet`, respectively, which have similar functions and interfaces and belong to the model components of the algorithm library. To manage these functionally similar modules, MMEngine implements the [registry](mmengine.registry.Registry). Most of the algorithm libraries in OpenMMLab use `registry` to manage their modules, including [MMDetection](https://github.com/open-mmlab/mmdetection), [MMDetection3D](https://github.com/open-mmlab/mmdetection3d), [MMClassification](https://github.com/open-mmlab/mmclassification) and [MMEditing](https://github.com/open-mmlab/mmediting), etc.
44

55
## What is a registry
66

docs/en/advanced_tutorials/test_time_augmentation.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ The following diagram illustrates this sequence of method calls:
103103
After data augmentation with TestTimeAug, the resulting data will have the following format:
104104

105105
```python
106-
image1 = dict(
106+
image1 = dict(
107107
inputs=[data_1_1, data_1_2],
108-
data_sample=[data_sample1_1, data_sample1_2])
109-
108+
data_sample=[data_sample1_1, data_sample1_2]
109+
)
110110

111-
image2 = dict(
111+
image2 = dict(
112112
inputs=[data_2_1, data_2_2],
113-
data_sample=[data_sample2_1, data_sample2_2])
114-
113+
data_sample=[data_sample2_1, data_sample2_2]
114+
)
115115

116-
image3 = dict(
116+
image3 = dict(
117117
inputs=[data_3_1, data_3_2],
118-
data_sample=[data_sample3_1, data_sample3_2])
119-
118+
data_sample=[data_sample3_1, data_sample3_2]
119+
)
120120
```
121121

122122
where `data_{i}_{j}` means the enhanced data,and `data_sample_{i}_{j}` means the ground truth of enhanced data. Then the data will be processed by `Dataloader`, which contributes to the following format:

docs/en/advanced_tutorials/visualization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def draw_featmap(
102102
# the layout when multiple channels are expanded into multiple images
103103
arrangement: Tuple[int, int] = (5, 2),
104104
# scale the feature map
105-
resize_shapeOptional[tuple] = None,
105+
resize_shape: Optional[tuple] = None,
106106
# overlay ratio between input image and generated feature map
107107
alpha: float = 0.5,
108108
) -> np.ndarray:

docs/en/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
'sphinx.ext.intersphinx',
4545
'sphinx.ext.napoleon',
4646
'sphinx.ext.viewcode',
47-
'sphinx.ext.autosectionlabel',
4847
'myst_parser',
4948
'sphinx_copybutton',
5049
'sphinx.ext.autodoc.typehints',

docs/en/design/hook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,4 @@ There are 22 mount points in the [Base Hook](mmengine.hooks.Hook).
201201
- before_save_checkpoint
202202
- after_load_checkpoint
203203

204-
Further readings: [Hook tutorial](../tutorials/hook.md) and [Hook API documentations](mmengine.hooks)
204+
Further readings: [Hook tutorial](../tutorials/hook.md) and [Hook API documentations](../api/hooks)

docs/en/design/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
![image](https://user-images.githubusercontent.com/57566630/163441489-47999f3a-3259-44ab-949c-77a8a599faa5.png)
1212

13-
Each scalar (losses, learning rates, etc.) during training is encapsulated by HistoryBuffer, managed by MessageHub in key-value pairs, formatted by LogProcessor and then exported to various visualization backends by [LoggerHook](mmengine.hook.LoggerHook). **In most cases, statistical methods of these scalars can be configured through the LogProcessor without understanding the data flow.** Before diving into the design of the logging system, please read through [logging tutorial](../advanced_tutorials/logging.md) first for familiarizing basic use cases.
13+
Each scalar (losses, learning rates, etc.) during training is encapsulated by HistoryBuffer, managed by MessageHub in key-value pairs, formatted by LogProcessor and then exported to various visualization backends by [LoggerHook](mmengine.hooks.LoggerHook). **In most cases, statistical methods of these scalars can be configured through the LogProcessor without understanding the data flow.** Before diving into the design of the logging system, please read through [logging tutorial](../advanced_tutorials/logging.md) first for familiarizing basic use cases.
1414

1515
## HistoryBuffer
1616

0 commit comments

Comments
 (0)