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

[Fix] Fix SegTTAModel with no attribute '_gt_sem_seg' error #3152

Merged
merged 4 commits into from
Jul 13, 2023

Conversation

ZiAn-Su
Copy link
Contributor

@ZiAn-Su ZiAn-Su commented Jun 30, 2023

Motivation

When using the - tta command for multi-scale prediction, and the test set is not annotated, although format_only has been set true in test_evaluator, but SegTTAModel class still threw error 'AttributeError: 'SegDataSample' object has no attribute '_gt_sem_seg''.

Modification

The reason is SegTTAModel didn't determine if there were annotations in the dataset, so I added the code to make the judgment and let the program run normally on my computer.

ZiAn-Su added 2 commits June 29, 2023 23:13
When using the - tta command for multi-scale prediction, and the test set is not annotated, although format_only has been set true in test_evaluator,  but SegTTAModel class  still threw error 'AttributeError: 'SegDataSample' object has no attribute '_gt_sem_seg''. The reason is SegTTAModel  didn't determine if there were annotations in the dataset, so I added the code to make the judgment and let the program run normally on my computer.
@shallweiwei
Copy link

shallweiwei commented Jul 11, 2023

I also encountered this bug.I changed the code with this method, but I can't see the progress bar now.
And the output is

envs/openmmlab/lib/python3.8/site-packages/mmengine/structures/pixel_data.py:83: UserWarning: The shape of value will convert from torch.Size([998, 998]) to torch.Size([1, 998, 998])

@shallweiwei
Copy link

shallweiwei commented Jul 11, 2023

I would add that I can still see the progress bar.It is because there are too many warnings……
And I found this,it looks like the input image is too small when using tta

RuntimeError: Calculated padded input size per channel: (1 x 6). Kernel size: (2 x 2). Kernel size can't be greater than actual input size

@ZiAn-Su
Copy link
Contributor Author

ZiAn-Su commented Jul 11, 2023

I would add that I can still see the progress bar.It is because there are too many warnings…… And I found this,it looks like the input image is too small when using tta

RuntimeError: Calculated padded input size per channel: (1 x 6). Kernel size: (2 x 2). Kernel size can't be greater than actual input size

I haven't encountered this problem, perhaps you can try increasing the zoom ratio in tta_pipeline to avoid the image being too small.

@xiexinch
Copy link
Collaborator

Hi @ZiAn-Su,
Would you update this PR? If you're busy, I can try to fix it.

@ZiAn-Su
Copy link
Contributor Author

ZiAn-Su commented Jul 13, 2023

Hi @ZiAn-Su, Would you update this PR? If you're busy, I can try to fix it.
Of course, sorry to be not familiar with the submission process. I'll update it immediately.

ZiAn-Su added 2 commits July 13, 2023 13:57
Update and remove unnecessary code
Modify format
@ZiAn-Su
Copy link
Contributor Author

ZiAn-Su commented Jul 13, 2023

Hi @ZiAn-Su, Would you update this PR? If you're busy, I can try to fix it.
Of course, sorry to be not familiar with the submission process. I'll update it immediately.

The new PR has been submitted. 😀

@xiexinch xiexinch changed the title Update seg tta py [Fix] Fix SegTTAModel with no attribute '_gt_sem_seg' error Jul 13, 2023
@xiexinch xiexinch merged commit 7254f53 into open-mmlab:dev-1.x Jul 13, 2023
@ZiAn-Su ZiAn-Su deleted the update_seg_tta_py branch July 14, 2023 01:09
nahidnazifi87 pushed a commit to nahidnazifi87/mmsegmentation_playground that referenced this pull request Apr 5, 2024
…ab#3152)

## Motivation

When using the - tta command for multi-scale prediction, and the test
set is not annotated, although format_only has been set true in
test_evaluator, but SegTTAModel class still threw error 'AttributeError:
'SegDataSample' object has no attribute '_gt_sem_seg''.

## Modification

The reason is SegTTAModel didn't determine if there were annotations in
the dataset, so I added the code to make the judgment and let the
program run normally on my computer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants