You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get fixed by changing the --palette cityscapes to --palette ade
I met the same problem as you @vgg4resnet, and I tried to use the cmd: python demo/image_demo.py demo/demo.png configs/swin/upernet_swin_base_patch4_window7_512x1024_80k.py checkpoint/swin_base_iter_80000.pth --device cuda:0 --palette ade
It still didn't work:
Use load_from_local loader
Traceback (most recent call last):
File "demo/image_demo.py", line 29, in <module>
main()
File "demo/image_demo.py", line 25, in main
show_result_pyplot(model, args.img, result, get_palette(args.palette))
File "/root/zsh5/foodseg/Swin-Transformer-Semantic-Segmentation/mmseg/apis/inference.py", line 115, in show_result_pyplot
img = model.show_result(img, result, palette=palette, show=False)
File "/root/zsh5/foodseg/Swin-Transformer-Semantic-Segmentation/mmseg/models/segmentors/base.py", line 246, in show_result
assert palette.shape[0] == len(self.CLASSES)
TypeError: object of type 'NoneType' has no len()
I have fixed the problem, it seems not caused by the version of mmsegmentation or mmcv for I didn't update them. I just change the code in demo/image_demo.py, line 25:
from show_result_pyplot(model, args.img, result, get_palette(args.palette))
to show_result_pyplot(model, args.img, result, model.PALETTE)
And if you use your own dataset, you should set the CLASSES of model object manually, just refer to: #452
Now seems everything is right, so I will close this issue.
Thanks for @MengzhangLI your help.
I met the same problem as you @vgg4resnet, and I tried to use the cmd:
python demo/image_demo.py demo/demo.png configs/swin/upernet_swin_base_patch4_window7_512x1024_80k.py checkpoint/swin_base_iter_80000.pth --device cuda:0 --palette ade
It still didn't work:
Here is my environment:
How can I fix the problem? Thx.
Originally posted by @SuhZhang in #494 (comment)
The text was updated successfully, but these errors were encountered: