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

Not able to load pre-trained model, or the model I trained given your instruction #26

Open
varsha-devi opened this issue Aug 24, 2021 · 4 comments

Comments

@varsha-devi
Copy link

Hello, First of all thanks alot for sharing such a great work. I used your code to train the model on MSR_VTT dataset, and I did that successfully, thanks for clear code and instructions. Now, I have "model_best.pth.tar" file. I also downloaded your model mrw_pvse.pth from github repo. Running eval.py is giving an error on loading model from a given path.

Even tried to load your model "mrw_pvse.pth" but the same error

" RuntimeError: Error(s) in loading state_dict for PVSE:
Missing key(s) in state_dict: "img_enc.cnn.conv1.weight", "img_enc.cnn.bn1.weight", "img_enc.cnn.bn1.bias", "img_enc.cnn.bn1.running_mean", "img_enc.cnn.bn1.running_var", "img_enc.cnn.layer1.0.conv1.weight", "img_enc.cnn.layer1.0.bn1.weight", "img_enc.cnn.layer1.0.bn1.bias", "img_enc.cnn.layer1.0.bn1.running_mean", "img_enc.cnn.layer1.0.bn1.running_var", "img_enc.cnn.layer1.0.conv2.weight", "img_enc.cnn.layer1.0.bn2.weight", "img_enc.cnn.layer1.0.bn2.bias", "img_enc.cnn.layer1.0.bn2.running_mean", "img_enc.cnn.layer1.0.bn2.running_var", "img_enc.cnn.layer1.0.conv3.weight", "img_enc.cnn.layer1.0.bn3.weight", "img_enc.cnn.layer1.0.bn3.bias", "img_enc.cnn.layer1.0.bn3.running_mean", "img_enc.cnn.layer1.0.bn3.running_var", "img_enc.cnn.layer1.0.downsample.0.weight", "img_enc.cnn.layer1.0.downsample.1.weight", "img_enc.cnn.layer1.0.downsample.1.bias", "img_enc.cnn.layer1.0.downsample.1.running_mean", "img_enc.cnn.layer1.0.downsample.1.running_var", "img_enc.cnn.layer1.1.conv1.weight", "img_enc.cnn.layer1.1.bn1.weight", "img_enc.cnn.layer1.1.bn1.bias", "img_enc.cnn.layer1.1.bn1.running_mean", "img_enc.cnn.layer1.1.bn1.running_var", "img_enc.cnn.layer1.1.conv2.weight", "img_enc.cnn.layer1.1.bn2.weight", "img_enc.cnn.layer1.1.bn2.bias", "img_enc.cnn.layer1.1.bn2.running_mean", "img_enc.cnn.layer1.1 .... so on"

Kindly guide me with this issue

@yalesong
Copy link
Owner

Are you switching between single-gpu and multi-gpu environments by any chance?

@varsha-devi
Copy link
Author

Are you switching between single-gpu and multi-gpu environments by any chance?

Thanks for your answer, No I am not switching, I am only based on single GPU. I am trying to load your model given for mrw dataset

@varsha-devi
Copy link
Author

Are you switching between single-gpu and multi-gpu environments by any chance?

Thanks for your answer, No I am not switching, I am only based on single GPU. I am trying to load your model given for mrw dataset

Hello, I successfully loaded the pre-trained model given for mrw dataset using the following command in eval.py script

"checkpoint = torch.load(args.ckpt)
model.load_state_dict(checkpoint, strict=False)"

is it right way to load your pre-trained model?

@ahustr
Copy link

ahustr commented Nov 14, 2023

这样写就行:
image

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

3 participants