[Fix] Fix seg name (#394)

* fix seg name

* use default name

Co-authored-by: dongchunyu.vendor <dongchunyu@pjlab.org.cn>
This commit is contained in:
AllentDan 2022-04-27 16:06:50 +08:00 committed by GitHub
parent 72c19e9d5d
commit a9a4144321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,5 +268,10 @@ class Segmentation(BaseTask):
"""
assert 'decode_head' in self.model_cfg.model, 'model config contains'
' no decode_head'
name = self.model_cfg.model.decode_head.type[:-4].lower()
if isinstance(self.model_cfg.model.decode_head, list):
name = self.model_cfg.model.decode_head[-1].type[:-4].lower()
elif 'type' in self.model_cfg.model.decode_head:
name = self.model_cfg.model.decode_head.type[:-4].lower()
else:
name = 'mmseg_model'
return name