-
Notifications
You must be signed in to change notification settings - Fork 145
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 Loading a custom trained model or resume training from a check point. #44
Comments
@abhineet-pandey Hi, if you would like to load the self-trained model and do inference, you can:
checkpoint['depth_model'] to checkpoint['model_state_dict'] and ensure strict=False (or remove the weights of depth_model.auxi_modules).
Resuming training from a self-trained model weight seems to contain no bugs for me. Thanks for your following and please comment casually if you still suffer from some problems. |
Thanks a lots. |
Hi! Thank you for your gorgeous work. I met the same problem. Could you explain more about "ensure strict=False (or remove the weights of depth_model.auxi_modules)", what exactly should I do? @guangkaixu @abhineet-pandey |
File "/mnt/disk/code/AdelaiDepth/LeReS/Train/lib/utils/net_tools.py", line 44, in load_ckpt
checkpoint_state_dict_noprefix = strip_prefix_if_present(checkpoint['model_state_dict'], "module.")
KeyError: 'model_state_dict'
With resuming training from a checkpoint or loading a self trained model.
Similar KeyError when loading a demo trained model in the Minist_test script (test_depth.py or test_shape.py)
To reproduce this error just train the demo model (..Train/scripts/train_demo.py) and try loading using the inference code in the Minist_test.
Please let me know if you need more details.
Any help would be much appreciated
The text was updated successfully, but these errors were encountered: