Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test error #1073

Closed
sunshiding opened this issue Nov 25, 2021 · 5 comments · Fixed by #1091
Closed

test error #1073

sunshiding opened this issue Nov 25, 2021 · 5 comments · Fixed by #1091
Assignees
Labels
bug Something isn't working

Comments

@sunshiding
Copy link

Hello. I am using the latest version of mmsegmentation and encountered a problem during testing. When I execute --show-dir, an error is reported, but when I don’t execute --show-dir, the evaluation can be done normally.

python tools/test.py ./configs/deeplabv3plus/deeplabv3plus_r50-d8_512x512_10k_voc12.py ./work_dirs/deeplabv3plus_r50-d8_512x512_10k_voc12/iter_6000.pth --eval mIoU mDice mFscore --show-dir deeplabv3plus_r50-d8_512x512_10k_voc12_results

The error is as follows,

load checkpoint from local path: ./work_dirs/deeplabv3plus_r50-d8_512x512_10k_voc12/iter_10000.pth
[ ] 0/115, elapsed: 0s, ETA:Traceback (most recent call last):
File "tools/test.py", line 229, in
main()
File "tools/test.py", line 191, in main
format_args=eval_kwargs)
File "/home/sunshiding/mmsegmentation-master/mmseg/apis/test.py", line 130, in single_gpu_test
opacity=opacity)
File "/home/sunshiding/mmsegmentation-master/mmseg/models/segmentors/base.py", line 247, in show_result
color_seg = np.zeros((seg.shape[0], seg.shape[1], 3), dtype=np.uint8)
AttributeError: 'tuple' object has no attribute 'shape'

@MengzhangLI MengzhangLI self-assigned this Nov 26, 2021
@MengzhangLI MengzhangLI added bug Something isn't working WIP Work in process labels Nov 26, 2021
@MengzhangLI
Copy link
Contributor

Hi, thanks for your feedback.

We have noticed potential bug about --show-dir. We would fix it as soon as possible.

@MengzhangLI
Copy link
Contributor

Hi, @sunshiding. This bug is fixed by @zergzzlun. Please have a look on related PR.

Best,

@MengzhangLI MengzhangLI removed the WIP Work in process label Dec 1, 2021
@sunshiding
Copy link
Author

Hi, @sunshiding. This bug is fixed by @zergzzlun. Please have a look on related PR.

Best,

Thank you very much, I have modified the code according to your guidance, and this problem has been solved.

@haims-hblab
Copy link

I got the same error.

While debuging, it seems that result at mmseg/models/segmentors/base.py (in attached image) is a tuple of list of tensor, which has no shape.
image

image

@haims-hblab
Copy link

This PR fixed it perfectly.
#1091

Please close this issue.

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants