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

Error when train customer dataset . #2283

Closed
ThorPham opened this issue Nov 9, 2022 · 11 comments
Closed

Error when train customer dataset . #2283

ThorPham opened this issue Nov 9, 2022 · 11 comments

Comments

@ThorPham
Copy link

ThorPham commented Nov 9, 2022

I has a dataset with 6 class and when i trained bug appear like this
ValueError: size shape must match input shape. Input is 2D, size is 3
This is a my dataset config
image
I traced my bug and bug in line

return F.interpolate(input, size, scale_factor, mode, align_corners)

and i print the "size" in F.interpolate
image
I don't know why the last shape is different other with 3D dimension
Here is full log bug
image
Can you help me fix ?

@MeowZheng
Copy link
Collaborator

I suggest you print the filename at

img_bytes = self.file_client.get(filename)

and
img_bytes = self.file_client.get(filename)

I think you might load wrong data

@ThorPham
Copy link
Author

ThorPham commented Nov 9, 2022

@MeowZheng here is log :
image
and here is custom dataset
image
My dataset with 6 class and annotation is format RGB space with extension png with 6 color.

@jinwonkim93
Copy link

Have you check those files?

@ThorPham
Copy link
Author

@jinwonkim93 Yes I write code read image and annotation and check shape of them. It's ok. Can you help me some other method to test those files.
image

@ThorPham
Copy link
Author

@jinwonkim93 @MeowZheng I know my problem. That is annotation have more than color in PALETTE

@ThorPham
Copy link
Author

@MeowZheng I just check shape ofresults.get('gt_semantic_seg') in VOC or coco is 2D. But my dataset is 3D.
Let me know the format dataset for the annotation i should convert

@jinwonkim93
Copy link

@ThorPham
Check this issue.
#1719

@ThorPham
Copy link
Author

@jinwonkim93 . I done with issue. Thank you so much

@RyanYip-Kat
Copy link

1669016197665

In fact, my annotation file is str_mask2, the dimension is also 2D, but after saving as an segmentation file, this error will still be reported? What's the matter, please? thank you

@ThorPham
Copy link
Author

@RyanYip-Kat can you show log error ?

@LaBiXiaoChai
Copy link

@RyanYip-Kat You successfully saved a single-channel picture using opencv, but when you re-read, you use a three-channel reading method, so it will be displayed as a three-channel. you can use cv2.imread("test.png", 0)

wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this issue Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants