cypw / PyTorch-MFNet

MIT License
252 stars 56 forks source link

load model warninng #5

Closed gooners1886 closed 6 years ago

gooners1886 commented 6 years ago

2018-11-01 12:03:35 WARNING: >> Failed to load: ['module.conv1.bn.num_batches_tracked', 'module.conv2.B01.conv_i1.bn.num_batches_tracked', 'module.conv2.B01.conv_i2.bn.num_batches_tracked', 'module.conv2.B01.conv_m1.bn.num_batches_tracked', 'module.conv2.B01.conv_m2.bn.num_batches_tracked', 'module.conv2.B01.conv_w1.bn.num_batches_tracked', 'module.conv2.B02.conv_i1.bn.num_batches_tracked', 'module.conv2.B02.conv_i2.bn.num_batches_tracked', 'module.conv2.B02.conv_m1.bn.num_batches_tracked', 'module.conv2.B02.conv_m2.bn.num_batches_tracked', 'module.conv2.B03.conv_i1.bn.num_batches_tracked', 'module.conv2.B03.conv_i2.bn.num_batches_tracked', 'module.conv2.B03.conv_m1.bn.num_batches_tracked', 'module.conv2.B03.conv_m2.bn.num_batches_tracked', 'module.conv3.B01.conv_i1.bn.num_batches_tracked', 'module.conv3.B01.conv_i2.bn.num_batches_tracked', 'module.conv3.B01.conv_m1.bn.num_batches_tracked', 'module.conv3.B01.conv_m2.bn.num_batches_tracked', 'module.conv3.B01.conv_w1.bn.num_batches_tracked', 'module.conv3.B02.conv_i1.bn.num_batches_tracked', 'module.conv3.B02.conv_i2.bn.num_batches_tracked', 'module.conv3.B02.conv_m1.bn.num_batches_tracked', 'module.conv3.B02.conv_m2.bn.num_batches_tracked', 'module.conv3.B03.conv_i1.bn.num_batches_tracked', 'module.conv3.B03.conv_i2.bn.num_batches_tracked', 'module.conv3.B03.conv_m1.bn.num_batches_tracked', 'module.conv3.B03.conv_m2.bn.num_batches_tracked', 'module.conv3.B04.conv_i1.bn.num_batches_tracked', 'module.conv3.B04.conv_i2.bn.num_batches_tracked', 'module.conv3.B04.conv_m1.bn.num_batches_tracked', 'module.conv3.B04.conv_m2.bn.num_batches_tracked', 'module.conv4.B01.conv_i1.bn.num_batches_tracked', 'module.conv4.B01.conv_i2.bn.num_batches_tracked', 'module.conv4.B01.conv_m1.bn.num_batches_tracked', 'module.conv4.B01.conv_m2.bn.num_batches_tracked', 'module.conv4.B01.conv_w1.bn.num_batches_tracked', 'module.conv4.B02.conv_i1.bn.num_batches_tracked', 'module.conv4.B02.conv_i2.bn.num_batches_tracked', 'module.conv4.B02.conv_m1.bn.num_batches_tracked', 'module.conv4.B02.conv_m2.bn.num_batches_tracked', 'module.conv4.B03.conv_i1.bn.num_batches_tracked', 'module.conv4.B03.conv_i2.bn.num_batches_tracked', 'module.conv4.B03.conv_m1.bn.num_batches_tracked', 'module.conv4.B03.conv_m2.bn.num_batches_tracked', 'module.conv4.B04.conv_i1.bn.num_batches_tracked', 'module.conv4.B04.conv_i2.bn.num_batches_tracked', 'module.conv4.B04.conv_m1.bn.num_batches_tracked', 'module.conv4.B04.conv_m2.bn.num_batches_tracked', 'module.conv4.B05.conv_i1.bn.num_batches_tracked', 'module.conv4.B05.conv_i2.bn.num_batches_tracked', 'module.conv4.B05.conv_m1.bn.num_batches_tracked', 'module.conv4.B05.conv_m2.bn.num_batches_tracked', 'module.conv4.B06.conv_i1.bn.num_batches_tracked', 'module.conv4.B06.conv_i2.bn.num_batches_tracked', 'module.conv4.B06.conv_m1.bn.num_batches_tracked', 'module.conv4.B06.conv_m2.bn.num_batches_tracked', 'module.conv5.B01.conv_i1.bn.num_batches_tracked', 'module.conv5.B01.conv_i2.bn.num_batches_tracked', 'module.conv5.B01.conv_m1.bn.num_batches_tracked', 'module.conv5.B01.conv_m2.bn.num_batches_tracked', 'module.conv5.B01.conv_w1.bn.num_batches_tracked', 'module.conv5.B02.conv_i1.bn.num_batches_tracked', 'module.conv5.B02.conv_i2.bn.num_batches_tracked', 'module.conv5.B02.conv_m1.bn.num_batches_tracked', 'module.conv5.B02.conv_m2.bn.num_batches_tracked', 'module.conv5.B03.conv_i1.bn.num_batches_tracked', 'module.conv5.B03.conv_i2.bn.num_batches_tracked', 'module.conv5.B03.conv_m1.bn.num_batches_tracked', 'module.conv5.B03.conv_m2.bn.num_batches_tracked', 'module.tail.bn.num_batches_tracked'] 2018-11-01 12:03:35 INFO: Only model state resumed from: ././../exps/models/MFNet3D_UCF-101_Split-1_96.3.pth_ep-0000.pth' 2018-11-01 12:03:35 WARNING: >> Epoch information inconsistant: 30 vs 0 2018-11-01 12:03:35 WARNING: VideoIter:: >>check_video' is off, `tolerant_corrupted_video' is automatically activated.

Should I neglect the warning while loading models?

cypw commented 6 years ago

The latest PyTorch introduced a new param for the BatchNorm layer. I guess it won't affect the testing results, you may just ignore this warning.

(Check here for more info.)

gooners1886 commented 6 years ago

@cypw thankyou. And another question about environment: I get error during training: 2018-11-01 13:27:30: Target dataset: 'UCF101', configs: {'num_classes': 101} /root/code/mfnet/mfnet3/network/initializer.py:12: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavieruniform. torch.nn.init.xavier_uniform(m.weight.data, gain=1.) /root/code/mfnet/mfnet3/network/initializer.py:20: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavieruniform. torch.nn.init.xavier_uniform(m.weight.data, gain=1.) 2018-11-01 13:27:30: Network:: graph initialized, loading pretrained model: /root/code/mfnet/mfnet3/network/pretrained/MFNet2D_ImageNet1k-0000.pth' 2018-11-01 13:27:30: Initializer:: loading from 2D neural network, filling method:inflation' ... Traceback (most recent call last): File "train_ucf101.py", line 139, in dataset_cfg) File "/root/code/mfnet/mfnet3/network/symbol_builder.py", line 9, in get_symbol net = MFNET_3D(kwargs) File "/root/code/mfnet/mfnet3/network/mfnet_3d.py", line 157, in init initializer.init_3d_from_2d_dict(net=self, state_dict=state_dict_2d, method=load_method) File "/root/code/mfnet/mfnet3/network/initializer.py", line 119, in init_3d_from_2d_dict param = filling_kernel(src=param, dshape=dst_param_shape, method=method) File "/root/code/mfnet/mfnet3/network/initializer.py", line 68, in fillingkernel dst.copy(src, broadcast=True) TypeError: copy_() got an unexpected keyword argument 'broadcast'

Does the version of pytorch 0.4.0 cause the error? I can not find the exactly address of PyTorch 0.4.0a0@a83c240 for video classification that mentioned in the README. That links to here: https://github.com/pytorch/pytorch but this is the lastest version of pytorch, not the specific version that you recommend to use. Can you give the address of you PyTorch version? Thanks !!!

cypw commented 6 years ago

There are some lines need to be fixed to match the lastest PyTorch. Sorry for the inconvenience, we will update the code with better performance in the near future.

For now, you can make the following changes to match the lastest PyTorch:

  1. "network/initializer.py": .copy(src, broadcast=True) --(change to)--> .copy(src)
  2. "train/metric.py#L122" change to: self.num_inst += loss.numpy().size
  3. use: Torch.no_grad() for eval

PyTorch 0.4.0a0@a83c240: https://github.com/pytorch/pytorch/commit/a83c240644116c204e93bbbffba8b8d948601cd0

gooners1886 commented 6 years ago

@cypw Thanks.