pvse icon indicating copy to clipboard operation
pvse copied to clipboard

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

Open varsha-devi opened this issue 2 years ago • 4 comments

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

varsha-devi avatar Aug 24 '21 10:08 varsha-devi

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

yalesong avatar Aug 25 '21 21:08 yalesong

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 avatar Sep 08 '21 11:09 varsha-devi

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?

varsha-devi avatar Sep 08 '21 15:09 varsha-devi

这样写就行: image

ahustr avatar Nov 14 '23 06:11 ahustr