Skip to content

Commit 0556fee

Browse files
authored
Replace convert_syncbatchnorm in mmseg (#93)
* replace convert_syncbatchnorm with revert_sync_batchnorm from mmcv * change logger
1 parent 003cf1b commit 0556fee

File tree

7 files changed

+10
-68
lines changed

7 files changed

+10
-68
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
_base_ = ['./segmentation_static.py', '../_base_/backends/pplnn.py']
2+
3+
onnx_config = dict(input_shape=[1024, 512])
4+
5+
backend_config = dict(model_inputs=dict(opt_shape=[1, 3, 512, 1024]))

docs/en/codebases/mmseg.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Please refer to [get_started.md](https://github.com/open-mmlab/mmsegmentation/bl
1515
| DeepLabV3 | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/deeplabv3) |
1616
| DeepLabV3+ | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/deeplabv3plus) |
1717
| Fast-SCNN[*](#static_shape) | Y | Y | N | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/fastscnn) |
18-
| UNet | Y | Y | Y | N | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/unet) |
18+
| UNet[*](#static_shape) | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/unet) |
1919

2020
### Reminder
2121

docs/en/supported_models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The table below lists the models that are guaranteed to be exportable to other b
2828
| DeepLabV3 | MMSegmentation | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/deeplabv3) |
2929
| DeepLabV3+ | MMSegmentation | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/deeplabv3plus) |
3030
| Fast-SCNN[*static](#note) | MMSegmentation | Y | Y | N | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/fastscnn) |
31-
| UNet | MMSegmentation | Y | Y | Y | N | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/unet) |
31+
| UNet[*static](#note) | MMSegmentation | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmsegmentation/tree/master/configs/unet) |
3232
| SRCNN | MMEditing | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmediting/tree/master/configs/restorers/srcnn) |
3333
| ESRGAN | MMEditing | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmediting/tree/master/configs/restorers/esrgan) |
3434
| SRGAN | MMEditing | Y | Y | Y | Y | Y | [config](https://github.com/open-mmlab/mmediting/tree/master/configs/restorers/srresnet_srgan) |
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22
from .mmsegmentation import MMSegmentation
33
from .segmentation import Segmentation
4-
from .utils import convert_syncbatchnorm
54

6-
__all__ = ['convert_syncbatchnorm', 'MMSegmentation', 'Segmentation']
5+
__all__ = ['MMSegmentation', 'Segmentation']

mmdeploy/codebase/mmseg/deploy/segmentation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ def init_pytorch_model(self,
8989
codebases.
9090
"""
9191
from mmseg.apis import init_segmentor
92-
from mmdeploy.codebase.mmseg.deploy import convert_syncbatchnorm
92+
from mmcv.cnn.utils import revert_sync_batchnorm
9393
model = init_segmentor(self.model_cfg, model_checkpoint, self.device)
94-
model = convert_syncbatchnorm(model)
95-
94+
model = revert_sync_batchnorm(model)
9695
return model.eval()
9796

9897
def create_input(self,

mmdeploy/codebase/mmseg/deploy/utils.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

tests/test_codebase/test_mmseg/test_mmseg_utils.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)