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

Changing IDAup out_dim raised RuntimeError when loading a checkpoint #7

Closed
sunxiaoyang01 opened this issue Jun 17, 2024 · 10 comments
Closed

Comments

@sunxiaoyang01
Copy link

image
It is a very excellent job! But I get an issue. I am currently encountering a dimension mismatch problem when setting the upsampling dimensions to (3,3) in the DLA model. Despite my efforts, I have not been able to resolve this issue.

@Alexandre-Delplanque
Copy link
Owner

Hi @sunxiaoyang01 ,
Thanks for opening this issue.
Could you please provide the code you ran that caused the error?

@sunxiaoyang01
Copy link
Author

Of course I can.
image

@Alexandre-Delplanque
Copy link
Owner

@sunxiaoyang01 ,
The error has occurred because you have tried to load a checkpoint whose parameters do not match the architecture of your model.
Try setting pretrained=False when instantiating the model.

@Alexandre-Delplanque Alexandre-Delplanque changed the title I get a wrong for the herdnet Changing IDAup out_dim raised RuntimeError Jun 17, 2024
@sunxiaoyang01
Copy link
Author

image
Yes, I have pre trained=False, but this issue still occurs

Repository owner deleted a comment from sunxiaoyang01 Jun 19, 2024
@Alexandre-Delplanque
Copy link
Owner

@sunxiaoyang01 ,
Thank you for providing the code snippet. Next time, please provide me with the entire code you ran when opening the issue, so that I can better understand the cause of the error.

The error still appears because you're loading parameters from a checkpoint, which again doesn't match the architecture you've modified:
model.load_state_dict(checkpoint(['model_state_dict'])

@Alexandre-Delplanque Alexandre-Delplanque changed the title Changing IDAup out_dim raised RuntimeError Changing IDAup out_dim raised RuntimeError when loading a checkpoint Jun 19, 2024
@sunxiaoyang01
Copy link
Author

sunxiaoyang01 commented Jun 19, 2024 via email

@Alexandre-Delplanque
Copy link
Owner

@sunxiaoyang01 ,
I don't see any code or screenshot, please provide enough details for me to understand the error.

@sunxiaoyang01
Copy link
Author

sunxiaoyang01 commented Jun 20, 2024 via email

@Alexandre-Delplanque
Copy link
Owner

@sunxiaoyang01 ,
Please put it directly on Github

@Alexandre-Delplanque
Copy link
Owner

Hi @sunxiaoyang01,
Problem solved?

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

No branches or pull requests

2 participants