-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
SizeMismatchError When trying to train a model using a custom dataset #194
Comments
That was my bad on this one, miscommunicating with the coworkers on how the dataset & json was build. |
@vylly hi, I miss the same problem but what makes the problem? Whether the size of the image in json is not right? |
@XiaoJiNu Yes exactly, in my case the issue was that we modified some of the image sizes without updating the json file so there was a difference between what was written in the json and the actual size of the images |
hi this is my error , do you know how to solve it?
|
I too am getting the same exact error. And on rerunning the code several times, it sometimes passes without showing this error.
|
i use rectLabel to generate the coco json file, it worked.I never received this error again |
Mismatched (W,H) for image /content/Mask_RCNNtrain/IMG_0855.jpeg, got (4032, 3024), expect (3024, 4032) |
i have solved this question,You can take a look through this link! |
Hi, in my case it was due to exif metadata which rotates the image. detectron2 uses Pillow to load in the data during shape checkin which does the auto rotation, cv2.imread() however doesnt. To fix this take a look at this answer! https://stackoverflow.com/questions/19786301/python-remove-exif-info-from-images |
I'm trying to train a model using a custom dataset (I made sure to have a COCO style json file for my dataset) but when I'm trying to train a model using it I receive a SizeMismatchError.
Here is the code for what I'm doing :
And here is the log :
The size mismatch error is always a factor of 2 but when printing the size of an image and its reference in the json they actually match :
Anybody encountered this issue ?
The text was updated successfully, but these errors were encountered: