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
I am trying to run python demo/image_demo.py demo/food.png checkpoints/CCNet_ReLeM/ccnet_r50-d8_512x1024_80k.py checkpoints/CCNet_ReLeM/iter_80000.pth --device cuda:0 --palette cityscapes
where the model and config file are sent from the author. But I met the error below:
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)
AssertionError
It seems that the length of CLASSES is not right. How can I fix the problem?
Hi SuhZhang,
I'm not an admin of this page but since I was facing the same problem I can respond to you. You are providing the model with the wrong palette of colors since you should have as much segmentation colors as classes of prediction. To solve this issue, just get ride of the argument: get_palette(args.palette) in the function show_result_pyplot(). Random palette with the right size will be generated
I am trying to run
python demo/image_demo.py demo/food.png checkpoints/CCNet_ReLeM/ccnet_r50-d8_512x1024_80k.py checkpoints/CCNet_ReLeM/iter_80000.pth --device cuda:0 --palette cityscapes
where the model and config file are sent from the author. But I met the error below:
It seems that the length of CLASSES is not right. How can I fix the problem?
My environment:
The text was updated successfully, but these errors were encountered: