Closed abhineet-pandey closed 2 years ago
@abhineet-pandey Hi, if you would like to load the self-trained model and do inference, you can: https://github.com/aim-uofa/AdelaiDepth/blob/c5370f150c10fd17761c835fca9b5956c3bff9fe/LeReS/Minist_Test/lib/net_tools.py#L40 modify 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.
@abhineet-pandey Hi, if you would like to load the self-trained model and do inference, you can:
modify
checkpoint['depth_model']
tocheckpoint['model_state_dict']
and ensurestrict=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.
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