hassony2 / kinetics_i3d_pytorch

Inflated i3d network with inception backbone, weights transfered from tensorflow
MIT License
528 stars 115 forks source link

size mismatch when run "python i3d_tf_to_pt.py --rgb" #20

Open liuyuemaicha opened 6 years ago

liuyuemaicha commented 6 years ago

Hi, Thank you for your work, firstly. I want to transfer the pre-training parameters in Tensorflow to PyTorch. But when I run "python i3d_tf_to_pt.py --rgb", I have the bugs as follows: Additionally, I want to know, the pre-training parameters (model/model_rgb.pth) in PyTorch you provide if as same as the Tensorflow ? Thank you very much !


2018-11-02 16:23:32.948892: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
  File "i3d_tf_to_pt.py", line 177, in <module>
    modality='rgb')
  File "i3d_tf_to_pt.py", line 73, in transfer_weights
    i3nception_pt.load_tf_weights(sess)
  File "/Users/cuixiankun01/project/baidu/kinetics_i3d_pytorch-master/src/i3dpt.py", line 310, in load_tf_weights
    self.load_state_dict(state_dict)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for I3D:
        size mismatch for conv3d_1a_7x7.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_1a_7x7.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_1a_7x7.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2b_1x1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2b_1x1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2b_1x1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2c_3x3.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for conv3d_2c_3x3.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for conv3d_2c_3x3.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3b.branch_0.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3b.branch_0.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3b.branch_0.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3b.branch_1.0.batch3d.running_var: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3b.branch_1.0.batch3d.bias: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3b.branch_1.0.batch3d.running_mean: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3b.branch_1.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3b.branch_1.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3b.branch_1.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3b.branch_2.0.batch3d.running_var: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_3b.branch_2.0.batch3d.bias: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_3b.branch_2.0.batch3d.running_mean: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_3b.branch_2.1.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_2.1.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_2.1.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_3.1.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_3.1.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_3.1.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.1.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3c.branch_1.1.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3c.branch_1.1.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3c.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_2.1.batch3d.running_var: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3c.branch_2.1.batch3d.bias: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3c.branch_2.1.batch3d.running_mean: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3c.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3c.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3c.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4b.branch_0.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_4b.branch_0.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_4b.branch_0.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_4b.branch_1.0.batch3d.running_var: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_4b.branch_1.0.batch3d.bias: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_4b.branch_1.0.batch3d.running_mean: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_4b.branch_1.1.batch3d.running_var: copying a param of torch.Size([208]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 208]) in current model.
        size mismatch for mixed_4b.branch_1.1.batch3d.bias: copying a param of torch.Size([208]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 208]) in current model.
        size mismatch for mixed_4b.branch_1.1.batch3d.running_mean: copying a param of torch.Size([208]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 208]) in current model.
        size mismatch for mixed_4b.branch_2.0.batch3d.running_var: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_4b.branch_2.0.batch3d.bias: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_4b.branch_2.0.batch3d.running_mean: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_4b.branch_2.1.batch3d.running_var: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_4b.branch_2.1.batch3d.bias: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_4b.branch_2.1.batch3d.running_mean: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_4b.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4b.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4b.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_0.batch3d.running_var: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4c.branch_0.batch3d.bias: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4c.branch_0.batch3d.running_mean: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4c.branch_1.0.batch3d.running_var: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4c.branch_1.0.batch3d.bias: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4c.branch_1.0.batch3d.running_mean: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4c.branch_1.1.batch3d.running_var: copying a param of torch.Size([224]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 224]) in current model.
        size mismatch for mixed_4c.branch_1.1.batch3d.bias: copying a param of torch.Size([224]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 224]) in current model.
        size mismatch for mixed_4c.branch_1.1.batch3d.running_mean: copying a param of torch.Size([224]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 224]) in current model.
        size mismatch for mixed_4c.branch_2.0.batch3d.running_var: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4c.branch_2.0.batch3d.bias: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4c.branch_2.0.batch3d.running_mean: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4c.branch_2.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_2.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_2.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.1.batch3d.running_var: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4d.branch_1.1.batch3d.bias: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4d.branch_1.1.batch3d.running_mean: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4d.branch_2.0.batch3d.running_var: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4d.branch_2.0.batch3d.bias: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4d.branch_2.0.batch3d.running_mean: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4d.branch_2.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_2.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_2.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_0.batch3d.running_var: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4e.branch_0.batch3d.bias: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4e.branch_0.batch3d.running_mean: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4e.branch_1.0.batch3d.running_var: copying a param of torch.Size([144]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 144]) in current model.
        size mismatch for mixed_4e.branch_1.0.batch3d.bias: copying a param of torch.Size([144]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 144]) in current model.
        size mismatch for mixed_4e.branch_1.0.batch3d.running_mean: copying a param of torch.Size([144]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 144]) in current model.
        size mismatch for mixed_4e.branch_1.1.batch3d.running_var: copying a param of torch.Size([288]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 288]) in current model.
        size mismatch for mixed_4e.branch_1.1.batch3d.bias: copying a param of torch.Size([288]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 288]) in current model.
        size mismatch for mixed_4e.branch_1.1.batch3d.running_mean: copying a param of torch.Size([288]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 288]) in current model.
        size mismatch for mixed_4e.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4e.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4e.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4e.branch_2.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_2.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_2.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4f.branch_0.batch3d.running_var: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4f.branch_0.batch3d.bias: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4f.branch_0.batch3d.running_mean: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4f.branch_1.0.batch3d.running_var: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4f.branch_1.0.batch3d.bias: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4f.branch_1.0.batch3d.running_mean: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4f.branch_1.1.batch3d.running_var: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_4f.branch_1.1.batch3d.bias: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_4f.branch_1.1.batch3d.running_mean: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_4f.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4f.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4f.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4f.branch_2.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_2.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_2.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_3.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_3.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_3.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_0.batch3d.running_var: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_5b.branch_0.batch3d.bias: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_5b.branch_0.batch3d.running_mean: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_5b.branch_1.0.batch3d.running_var: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_5b.branch_1.0.batch3d.bias: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_5b.branch_1.0.batch3d.running_mean: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_5b.branch_1.1.batch3d.running_var: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_5b.branch_1.1.batch3d.bias: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_5b.branch_1.1.batch3d.running_mean: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_5b.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_5b.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_5b.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_5b.branch_2.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_2.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_2.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_3.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_3.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_3.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_0.batch3d.running_var: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_0.batch3d.bias: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_0.batch3d.running_mean: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_1.0.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_5c.branch_1.0.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_5c.branch_1.0.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_5c.branch_1.1.batch3d.running_var: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_1.1.batch3d.bias: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_1.1.batch3d.running_mean: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_2.0.batch3d.running_var: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_5c.branch_2.0.batch3d.bias: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_5c.branch_2.0.batch3d.running_mean: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_5c.branch_2.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_2.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_2.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_3.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_3.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_3.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
windIsMyHeart commented 6 years ago

Hi, Thank you for your work, firstly. I want to transfer the pre-training parameters in Tensorflow to PyTorch. But when I run "python i3d_tf_to_pt.py --rgb", I have the bugs as follows: Additionally, I want to know, the pre-training parameters (model/model_rgb.pth) in PyTorch you provide if as same as the Tensorflow ? Thank you very much !


2018-11-02 16:23:32.948892: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Traceback (most recent call last):
  File "i3d_tf_to_pt.py", line 177, in <module>
    modality='rgb')
  File "i3d_tf_to_pt.py", line 73, in transfer_weights
    i3nception_pt.load_tf_weights(sess)
  File "/Users/cuixiankun01/project/baidu/kinetics_i3d_pytorch-master/src/i3dpt.py", line 310, in load_tf_weights
    self.load_state_dict(state_dict)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for I3D:
        size mismatch for conv3d_1a_7x7.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_1a_7x7.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_1a_7x7.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2b_1x1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2b_1x1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2b_1x1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for conv3d_2c_3x3.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for conv3d_2c_3x3.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for conv3d_2c_3x3.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3b.branch_0.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3b.branch_0.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3b.branch_0.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3b.branch_1.0.batch3d.running_var: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3b.branch_1.0.batch3d.bias: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3b.branch_1.0.batch3d.running_mean: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3b.branch_1.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3b.branch_1.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3b.branch_1.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3b.branch_2.0.batch3d.running_var: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_3b.branch_2.0.batch3d.bias: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_3b.branch_2.0.batch3d.running_mean: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_3b.branch_2.1.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_2.1.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_2.1.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_3.1.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_3.1.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3b.branch_3.1.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_3c.branch_1.1.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3c.branch_1.1.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3c.branch_1.1.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_3c.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_3c.branch_2.1.batch3d.running_var: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3c.branch_2.1.batch3d.bias: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3c.branch_2.1.batch3d.running_mean: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_3c.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3c.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_3c.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4b.branch_0.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_4b.branch_0.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_4b.branch_0.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_4b.branch_1.0.batch3d.running_var: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_4b.branch_1.0.batch3d.bias: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_4b.branch_1.0.batch3d.running_mean: copying a param of torch.Size([96]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 96]) in current model.
        size mismatch for mixed_4b.branch_1.1.batch3d.running_var: copying a param of torch.Size([208]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 208]) in current model.
        size mismatch for mixed_4b.branch_1.1.batch3d.bias: copying a param of torch.Size([208]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 208]) in current model.
        size mismatch for mixed_4b.branch_1.1.batch3d.running_mean: copying a param of torch.Size([208]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 208]) in current model.
        size mismatch for mixed_4b.branch_2.0.batch3d.running_var: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_4b.branch_2.0.batch3d.bias: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_4b.branch_2.0.batch3d.running_mean: copying a param of torch.Size([16]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 16]) in current model.
        size mismatch for mixed_4b.branch_2.1.batch3d.running_var: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_4b.branch_2.1.batch3d.bias: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_4b.branch_2.1.batch3d.running_mean: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_4b.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4b.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4b.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_0.batch3d.running_var: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4c.branch_0.batch3d.bias: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4c.branch_0.batch3d.running_mean: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4c.branch_1.0.batch3d.running_var: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4c.branch_1.0.batch3d.bias: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4c.branch_1.0.batch3d.running_mean: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4c.branch_1.1.batch3d.running_var: copying a param of torch.Size([224]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 224]) in current model.
        size mismatch for mixed_4c.branch_1.1.batch3d.bias: copying a param of torch.Size([224]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 224]) in current model.
        size mismatch for mixed_4c.branch_1.1.batch3d.running_mean: copying a param of torch.Size([224]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 224]) in current model.
        size mismatch for mixed_4c.branch_2.0.batch3d.running_var: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4c.branch_2.0.batch3d.bias: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4c.branch_2.0.batch3d.running_mean: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4c.branch_2.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_2.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_2.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4c.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.0.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.0.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.0.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4d.branch_1.1.batch3d.running_var: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4d.branch_1.1.batch3d.bias: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4d.branch_1.1.batch3d.running_mean: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4d.branch_2.0.batch3d.running_var: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4d.branch_2.0.batch3d.bias: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4d.branch_2.0.batch3d.running_mean: copying a param of torch.Size([24]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 24]) in current model.
        size mismatch for mixed_4d.branch_2.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_2.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_2.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4d.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_0.batch3d.running_var: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4e.branch_0.batch3d.bias: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4e.branch_0.batch3d.running_mean: copying a param of torch.Size([112]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 112]) in current model.
        size mismatch for mixed_4e.branch_1.0.batch3d.running_var: copying a param of torch.Size([144]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 144]) in current model.
        size mismatch for mixed_4e.branch_1.0.batch3d.bias: copying a param of torch.Size([144]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 144]) in current model.
        size mismatch for mixed_4e.branch_1.0.batch3d.running_mean: copying a param of torch.Size([144]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 144]) in current model.
        size mismatch for mixed_4e.branch_1.1.batch3d.running_var: copying a param of torch.Size([288]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 288]) in current model.
        size mismatch for mixed_4e.branch_1.1.batch3d.bias: copying a param of torch.Size([288]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 288]) in current model.
        size mismatch for mixed_4e.branch_1.1.batch3d.running_mean: copying a param of torch.Size([288]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 288]) in current model.
        size mismatch for mixed_4e.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4e.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4e.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4e.branch_2.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_2.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_2.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_3.1.batch3d.running_var: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_3.1.batch3d.bias: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4e.branch_3.1.batch3d.running_mean: copying a param of torch.Size([64]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 64]) in current model.
        size mismatch for mixed_4f.branch_0.batch3d.running_var: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4f.branch_0.batch3d.bias: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4f.branch_0.batch3d.running_mean: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_4f.branch_1.0.batch3d.running_var: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4f.branch_1.0.batch3d.bias: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4f.branch_1.0.batch3d.running_mean: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_4f.branch_1.1.batch3d.running_var: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_4f.branch_1.1.batch3d.bias: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_4f.branch_1.1.batch3d.running_mean: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_4f.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4f.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4f.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_4f.branch_2.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_2.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_2.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_3.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_3.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_4f.branch_3.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_0.batch3d.running_var: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_5b.branch_0.batch3d.bias: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_5b.branch_0.batch3d.running_mean: copying a param of torch.Size([256]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 256]) in current model.
        size mismatch for mixed_5b.branch_1.0.batch3d.running_var: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_5b.branch_1.0.batch3d.bias: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_5b.branch_1.0.batch3d.running_mean: copying a param of torch.Size([160]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 160]) in current model.
        size mismatch for mixed_5b.branch_1.1.batch3d.running_var: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_5b.branch_1.1.batch3d.bias: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_5b.branch_1.1.batch3d.running_mean: copying a param of torch.Size([320]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 320]) in current model.
        size mismatch for mixed_5b.branch_2.0.batch3d.running_var: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_5b.branch_2.0.batch3d.bias: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_5b.branch_2.0.batch3d.running_mean: copying a param of torch.Size([32]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 32]) in current model.
        size mismatch for mixed_5b.branch_2.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_2.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_2.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_3.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_3.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5b.branch_3.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_0.batch3d.running_var: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_0.batch3d.bias: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_0.batch3d.running_mean: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_1.0.batch3d.running_var: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_5c.branch_1.0.batch3d.bias: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_5c.branch_1.0.batch3d.running_mean: copying a param of torch.Size([192]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 192]) in current model.
        size mismatch for mixed_5c.branch_1.1.batch3d.running_var: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_1.1.batch3d.bias: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_1.1.batch3d.running_mean: copying a param of torch.Size([384]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 384]) in current model.
        size mismatch for mixed_5c.branch_2.0.batch3d.running_var: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_5c.branch_2.0.batch3d.bias: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_5c.branch_2.0.batch3d.running_mean: copying a param of torch.Size([48]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 48]) in current model.
        size mismatch for mixed_5c.branch_2.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_2.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_2.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_3.1.batch3d.running_var: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_3.1.batch3d.bias: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.
        size mismatch for mixed_5c.branch_3.1.batch3d.running_mean: copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128]) in current model.

你解决这个问题了吗

hassony2 commented 6 years ago

Hi !

If you look at the error the size mismatches are between tensors which have the same number of elements, also they only happen on the batchnorm parameters. Like "copying a param of torch.Size([128]) from checkpoint, where the shape is torch.Size([1, 1, 1, 1, 128])". My guess is that it might be a pytorch version issue. Which one are you using ?

An alternate solution might be to add the extra dimensions (using something like view(1, 1, 1, 1, -1) on each of the weights obtained from tensorflow probably somewhere here

Right now is pretty busy and I won't be able to look more into depth into this (meaning actually running code, experimenting with pytorch versions...) before the next 10 days :)

Let me know if you could solve this :)

Best !

Yana

liuyuemaicha commented 6 years ago

Hi, Thanks for your advise. I've found the problem. the shape of parameters from Tensorflow is [1, 1, 1, 1, n], mismatch the size from PyTorch ([n]). I've fixed the bug and make a pull request. Thanks for your help and great work ! 谢谢😁

$ python i3d_tf_to_pt.py --rgb 2018-11-07 15:09:42.636465: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

max diff : 0.0115141868591, mean diff : 2.91702690447e-05 mean val: tf 0.00250000040978 pt 0.00250000040978 max vals: tf 0.943557560444 pt 0.943576276302 max relative diff: tf 0.21941703558 pt 0.281093806028

max diff : 0.00800371170044, mean diff : 4.55450135632e-05 mean val: tf 0.00249999971129 pt 0.00249999994412 max vals: tf 0.602078437805 pt 0.610082149506 max relative diff: tf 0.148675397038 pt 0.174640089273

max diff : 0.0120238959789, mean diff : 4.93937077408e-05 mean val: tf 0.00249999994412 pt 0.00249999994412 max vals: tf 0.355097353458 pt 0.367121249437 max relative diff: tf 0.120408758521 pt 0.136891722679

hassony2 commented 6 years ago

Thank you for the pull request !

Before accepting it, I would like to look at what causes the problem (I still think it might be pytorch or tensorflow-version specific, so best before I merge would be to understand why it happened to you and not to me ! :) )

Best !

Yana

liuyuemaicha commented 6 years ago

Yes, you reminded me ! I updated my Pytorch from 0.3 to 0.4.1 recently, and yesterday I found the similar problem in another program. Thank you for your help even you are very busy now, I hope you will have a great reward !😊

Best ! Kun