yjxiong / tsn-pytorch

Temporal Segment Networks (TSN) in PyTorch
BSD 2-Clause "Simplified" License
1.07k stars 308 forks source link

Error in loading weights for BNInception module #53

Closed pengzhenghao closed 5 years ago

pengzhenghao commented 6 years ago

Hi Xiong, Thanks for your great codes. Trouble happen when I running the test_model.py following your instruction:

ucf101 RGB data/ucf101_splits kinetics_rgb.pth --arch BNInception --save_scores kinetics_flow_ucf101_scores.txt

wherein kinetics_rgb.pth comes from here by @shuangshuangguo

The errors look like:

RuntimeError: Error(s) in loading state_dict for BNInception:
...
While copying the parameter named "inception_4b_1x1_bn.running_mean", whose dimensions in the model are torch.Size([192]) and whose dimensions in the checkpoint are torch.Size([1, 192]).
...

Namely each module has it's weight in checkpoint with one more dimension, compared to what it supposed to be.

I am a beginner with PyTorch. Hope you can answer my question. Thanks you!

gongbudaizhe commented 6 years ago

try pytorch 0.3.1

shuangshuangguo commented 6 years ago

@PengZhenghao You can try to modify test_models.py as https://github.com/shuangshuangguo/caffe2pytorch-tsn/blob/master/test_models.py

Jenniferlyt commented 6 years ago

hello ,have you solved your problem? I have met the same error,I have no idea what i should do next. thanks a lot!I am looking forward for your early replay.

xiadingZ commented 5 years ago

You can see pretrainedmodels, it has pretrained bninception. I have succeed to run tsn-pytorch using pytorch1.0 with it.

gitxdf commented 5 years ago

You can see pretrainedmodels, it has pretrained bninception. I have succeed to run tsn-pytorch using pytorch1.0 with it.

hello, I am running tsn-pytorch using pytorch1.1, and get the issue of size mismatch. Could you share your code about this problem. Thanks.