-
Notifications
You must be signed in to change notification settings - Fork 195
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
Loading network weights with wrong state_dict fails silently #1508
Comments
Thanks for the suggestions. Thanks again for the suggestions, if you get time, you could raise a PR for your suggestions, I think they are useful to all users. Or we will put these items in TODO list and enhance in the normal dev plan. Thank you. |
Thanks for the quick response @tangy5. Hm yeah I get that for many models you want that value to be False. Why not set it to true in the BasicInferTask and then to False in every sample-app/model, where it is actually needed? I can add a PR however I'd need to know which of the two options you prefer:
|
I think the two items you proposed makes sense, feel free to raise a PR. You could add "-s" to your commit command, and our team can edit and test your branch, we will have CI/CD integration and unit tests and env build. I will also try and help if anything is missing or need discussion. Thanks again. |
I'll close this issue now since the code for it was already merged. However @tangy5 it would great if you can merge the second part as well: #1533 |
Describe the bug
I spent a few hours wondering why my network won't work and which of my transforms are broken, only to find out that the loading of the network did not work. Monailabel via default uses the "model" key for the state_dict, whereas my code uses the "net" key.
However running MONAILabel, the network is just initialized randomly and the loading of the weights fails completely silently.
The easiest solution would be to change the default value of
load_strict
toTrue
inBasicInferTask
.This would make a lot of sense for beginners. MONAILabel hides away the specifics of loading the network weights - the least I would expect is an error message telling me something may have gone wrong. In this case however it is certain that something went wrong so it would be even better for the program to fail imo.
The text was updated successfully, but these errors were encountered: