mmsegmentation
mmsegmentation copied to clipboard
模型导出错误:'EncoderDecoder' object has no attribute 'forward_dummy'
1、先是报如下错误:
Traceback (most recent call last):
File "/mnt/bn/shuaizzz/codes/mmsegmentation/tools/deployment/pytorch2torchscript_defect.py", line 201, in
AssertionError: test_cfg specified in both outer field and model field
我通过修改pytorch2torchscript.py文件的segmentor定义为test_cfg=None解决了这个报错。
2、然后又报错:
KeyError: 'SegDataPreProcessor is not in the model registry. Please check whether the value of SegDataPreProcessor
is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'
我通过修改pytorch2torchscript.py文件,添加如下两行,解决了上述报错: from mmseg.utils import register_all_modules register_all_modules()
3、随后又报错:
Traceback (most recent call last):
File "/mnt/bn/shuaizzz/codes/mmsegmentation/tools/deployment/pytorch2torchscript_defect.py", line 213, in
请问该如何解决?