TSN在pytorch1.0以上版本出现size mismatch for conv1_7x7_s2_bn.weight等错误

在pytorch1.0运行TSN时出现size mismatch错误

RuntimeError: Error(s) in loading state_dict for BNInception:
        size mismatch for conv1_7x7_s2_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv1_7x7_s2_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv1_7x7_s2_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv1_7x7_s2_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv2_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv2_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv2_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv2_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for conv2_3x3_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for conv2_3x3_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for conv2_3x3_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for conv2_3x3_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_3a_1x1_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_1x1_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_1x1_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_1x1_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_3x3_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3a_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3a_pool_proj_bn.weight: copying a param with shape torch.Size([1, 32]) from checkpoint, the shape in current model is torch.Size([32]).
        size mismatch for inception_3a_pool_proj_bn.bias: copying a param with shape torch.Size([1, 32]) from checkpoint, the shape in current model is torch.Size([32]).
        size mismatch for inception_3a_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 32]) from checkpoint, the shape in current model is torch.Size([32]).
        size mismatch for inception_3a_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 32]) from checkpoint, the shape in current model is torch.Size([32]).
        size mismatch for inception_3b_1x1_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_1x1_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_1x1_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_1x1_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_3x3_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_3x3_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_3x3_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_3x3_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3b_pool_proj_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_pool_proj_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3b_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3c_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_3c_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_3c_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_3c_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_3c_3x3_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_3c_3x3_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_3c_3x3_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_3c_3x3_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_3c_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3c_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3c_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3c_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_3c_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_3c_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_1x1_bn.weight: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_4a_1x1_bn.bias: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_4a_1x1_bn.running_mean: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_4a_1x1_bn.running_var: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_4a_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_4a_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_4a_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_4a_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 64]) from checkpoint, the shape in current model is torch.Size([64]).
        size mismatch for inception_4a_3x3_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_3x3_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_3x3_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_3x3_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4a_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_pool_proj_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_pool_proj_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4a_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_1x1_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4b_1x1_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4b_1x1_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4b_1x1_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4b_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_3x3_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_3x3_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_3x3_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_3x3_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4b_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_pool_proj_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_pool_proj_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4b_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_1x1_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_1x1_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_1x1_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_1x1_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_3x3_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_3x3_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_3x3_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_3x3_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4c_pool_proj_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_pool_proj_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4c_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_1x1_bn.weight: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4d_1x1_bn.bias: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4d_1x1_bn.running_mean: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4d_1x1_bn.running_var: copying a param with shape torch.Size([1, 96]) from checkpoint, the shape in current model is torch.Size([96]).
        size mismatch for inception_4d_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_3x3_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_3x3_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_3x3_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_3x3_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4d_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4d_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4d_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_4d_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4d_pool_proj_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_pool_proj_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4d_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4e_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4e_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4e_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4e_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_4e_3x3_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_3x3_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_3x3_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_3x3_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_4e_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_4e_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 256]) from checkpoint, the shape in current model is torch.Size([256]).
        size mismatch for inception_5a_1x1_bn.weight: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5a_1x1_bn.bias: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5a_1x1_bn.running_mean: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5a_1x1_bn.running_var: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5a_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5a_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5a_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5a_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5a_3x3_bn.weight: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5a_3x3_bn.bias: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5a_3x3_bn.running_mean: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5a_3x3_bn.running_var: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5a_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_5a_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_5a_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_5a_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 160]) from checkpoint, the shape in current model is torch.Size([160]).
        size mismatch for inception_5a_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5a_pool_proj_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5a_pool_proj_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5a_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5a_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5b_1x1_bn.weight: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5b_1x1_bn.bias: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5b_1x1_bn.running_mean: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5b_1x1_bn.running_var: copying a param with shape torch.Size([1, 352]) from checkpoint, the shape in current model is torch.Size([352]).
        size mismatch for inception_5b_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_3x3_bn.weight: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5b_3x3_bn.bias: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5b_3x3_bn.running_mean: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5b_3x3_bn.running_var: copying a param with shape torch.Size([1, 320]) from checkpoint, the shape in current model is torch.Size([320]).
        size mismatch for inception_5b_double_3x3_reduce_bn.weight: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_double_3x3_reduce_bn.bias: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_double_3x3_reduce_bn.running_mean: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_double_3x3_reduce_bn.running_var: copying a param with shape torch.Size([1, 192]) from checkpoint, the shape in current model is torch.Size([192]).
        size mismatch for inception_5b_double_3x3_1_bn.weight: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_1_bn.bias: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_1_bn.running_mean: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_1_bn.running_var: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_2_bn.weight: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_2_bn.bias: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_2_bn.running_mean: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_double_3x3_2_bn.running_var: copying a param with shape torch.Size([1, 224]) from checkpoint, the shape in current model is torch.Size([224]).
        size mismatch for inception_5b_pool_proj_bn.weight: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5b_pool_proj_bn.bias: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5b_pool_proj_bn.running_mean: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for inception_5b_pool_proj_bn.running_var: copying a param with shape torch.Size([1, 128]) from checkpoint, the shape in current model is torch.Size([128]).

在https://github.com/yjxiong/tsn-pytorch/issues/74 下找到解决方法:

先下载bn_inception-9f5701afb96c8044_fixed.pth文件并保存到/home/model/path,路径不是唯一的,可以自己创建一个文件夹保存进去

在tsn-pytorch-master/tf_model_zoo/bninception/pytorch_load.py下增加这几行

weight_path = '/home/model/path/pretrained_model/bn_inception-9f5701afb96c8044.pth'
weight_fixed_path = '/home/model/path/pretrained_model/bn_inception-9f5701afb96c8044_fixed.pth'
state_dict = torch.load(weight_path)
for name, weights in state_dict.items():
    if 'bn' in name :
        state_dict[name] = weights.squeeze(0)
torch.save(state_dict,weight_fixed_path)

并修改这几行

class BNInception(nn.Module):
    def init(self, model_path='tf_model_zoo/bninception/bn_inception.yaml', num_classes=101,
weight_url = weight_fixed_path):
#weight_url='https://yjxiong.blob.core.windows.net/models/bn_inception-9f5701afb96c8044.pth'):
        ...
        self.load_state_dict(torch.load(weight_url))
        #self.load_state_dict(torch.utils.model_zoo.load_url(weight_url))

 

你可能感兴趣的:(TSN,pytorch,Python,深度学习,python)