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

When I run segmentation code with my own dataset, it occurs the error... #6

Open
grbcwq123 opened this issue Apr 28, 2021 · 4 comments
Labels
question Further information is requested

Comments

@grbcwq123
Copy link

Hello !
When I match my dataset to the cityscapes, it does not work in the model initialization phase.
RuntimeError: Error(s) in loading state_dict for DeepLab:
size mismatch for classifier.0.convs.0.weight: copying a param with shape torch.Size([19, 2048, 3, 3]) from checkpoint, the shape in current model is torch.Size([4, 2048, 3, 3]).

My dataset contains only 5% labeled images. The size is 2048*1024,which is the same as the cityscapes. Could you help me find the probelm?

Thank you very much!

@voldemortX
Copy link
Owner

voldemortX commented Apr 28, 2021

@grbcwq123 Hi! Does your dataset has 4 classes? You should first convert the coco pre-trained weights with customized scripts, specifically, change the codes here to your number of classes.

I've also provided some instructions to train on customized dataset here, but I guess you've found them already.

@voldemortX voldemortX added the question Further information is requested label Apr 28, 2021
@grbcwq123
Copy link
Author

Thank you for your response !
Yes, my dataset has 4 classes.
But then it occurs this error.

error

What makes me confused is that there was no problem when I directly used the public cityscapes dataset.
I've changed those configuration files. Maybe it is related to my cuda or torch version?
Sorry for asking such simple questions, but I really try several times.
Thank you very much!

@voldemortX
Copy link
Owner

@grbcwq123 It seems by the first line warning your apex is not correctly installed. I'd say maybe use a new virtual environment to reinstall the dependencies?The exact cuda and torch version may be crucial.

If that can't be done, you can try if you can run the code without mixed precision first.

@grbcwq123
Copy link
Author

Thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants