We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1f4f51 commit f705071Copy full SHA for f705071
tools/pytorch2onnx.py
@@ -5,11 +5,11 @@
5
import numpy as np
6
import onnxruntime as rt
7
import torch
8
-from torch import nn
9
import torch._C
10
import torch.serialization
11
from mmcv.onnx import register_extra_symbolics
12
from mmcv.runner import load_checkpoint
+from torch import nn
13
14
from mmseg.models import build_segmentor
15
@@ -186,11 +186,6 @@ def parse_args():
186
# convert SyncBN to BN
187
segmentor = _convert_batchnorm(segmentor)
188
189
- if isinstance(segmentor.decode_head, nn.ModuleList):
190
- num_classes = segmentor.decode_head[-1].num_classes
191
- else:
192
- num_classes = segmentor.decode_head.num_classes
193
-
194
if args.checkpoint:
195
load_checkpoint(segmentor, args.checkpoint, map_location='cpu')
196
0 commit comments