second.pytorch: Error on evaluating on pretrained car_fhd

Hi,

I’m getting the following error on trying to evaluate the model using the pretrained weights in car_fhd. If anyone has a workaround, kindly let me know. Thanks!

python pytorch/train.py evaluate --config_path=configs/car.fhd.config --model_dir=second --measure_time=True --batch_size=1
/home/navaneeth/anaconda3/lib/python3.7/site-packages/dask/config.py:168: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  data = yaml.load(f.read()) or {}
[  41 1600 1408]
Traceback (most recent call last):
  File "pytorch/train.py", line 684, in <module>
    fire.Fire()
  File "/home/navaneeth/anaconda3/lib/python3.7/site-packages/fire/core.py", line 138, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/home/navaneeth/anaconda3/lib/python3.7/site-packages/fire/core.py", line 471, in _Fire
    target=component.__name__)
  File "/home/navaneeth/anaconda3/lib/python3.7/site-packages/fire/core.py", line 675, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "pytorch/train.py", line 479, in evaluate
    torchplus.train.try_restore_latest_checkpoints(model_dir, [net])
  File "/home/navaneeth/workspace/3d-object-detection/second.pytorch/torchplus/train/checkpoint.py", line 149, in try_restore_latest_checkpoints
    restore(latest_ckpt, model, map_func)
  File "/home/navaneeth/workspace/3d-object-detection/second.pytorch/torchplus/train/checkpoint.py", line 120, in restore
    model.load_state_dict(state_dict)
  File "/home/navaneeth/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for VoxelNet:
        Unexpected key(s) in state_dict: "rpn.blocks.1.1.weight", "rpn.blocks.1.2.weight", "rpn.blocks.1.2.bias", "rpn.blocks.1.2.running_mean", "rpn.blocks.1.2.running_var", "rpn.blocks.1.2.num_batches_tracked", "rpn.blocks.1.4.weight", "rpn.blocks.1.5.weight", "rpn.blocks.1.5.bias", "rpn.blocks.1.5.running_mean", "rpn.blocks.1.5.running_var", "rpn.blocks.1.5.num_batches_tracked", "rpn.blocks.1.7.weight", "rpn.blocks.1.8.weight", "rpn.blocks.1.8.bias", "rpn.blocks.1.8.running_mean", "rpn.blocks.1.8.running_var", "rpn.blocks.1.8.num_batches_tracked", "rpn.blocks.1.10.weight", "rpn.blocks.1.11.weight", "rpn.blocks.1.11.bias", "rpn.blocks.1.11.running_mean", "rpn.blocks.1.11.running_var", "rpn.blocks.1.11.num_batches_tracked", "rpn.blocks.1.13.weight", "rpn.blocks.1.14.weight", "rpn.blocks.1.14.bias", "rpn.blocks.1.14.running_mean", "rpn.blocks.1.14.running_var", "rpn.blocks.1.14.num_batches_tracked", "rpn.blocks.1.16.weight", "rpn.blocks.1.17.weight", "rpn.blocks.1.17.bias", "rpn.blocks.1.17.running_mean", "rpn.blocks.1.17.running_var", "rpn.blocks.1.17.num_batches_tracked", "rpn.deblocks.1.0.weight", "rpn.deblocks.1.1.weight", "rpn.deblocks.1.1.bias", "rpn.deblocks.1.1.running_mean", "rpn.deblocks.1.1.running_var", "rpn.deblocks.1.1.num_batches_tracked". 
        size mismatch for rpn.deblocks.0.0.weight: copying a param with shape torch.Size([128, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([128, 128, 1, 1]).
        size mismatch for rpn.deblocks.0.1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for rpn.deblocks.0.1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for rpn.deblocks.0.1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for rpn.deblocks.0.1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([128]).
        size mismatch for rpn.conv_cls.weight: copying a param with shape torch.Size([2, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([2, 128, 1, 1]).
        size mismatch for rpn.conv_box.weight: copying a param with shape torch.Size([14, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([14, 128, 1, 1]).
        size mismatch for rpn.conv_dir_cls.weight: copying a param with shape torch.Size([4, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([4, 128, 1, 1]).

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 3
  • Comments: 18

Most upvoted comments

@jhultman awesome! i reinstalled spconv module after checking out to the commit number that you have mentioned. it works fine now. kindly update the README file. thanks!

Hi @USTC-Keyanjie, I think he is suggesting switching to branch v1.5 and not the master branch.

However, I tried switching to branch v1.5 but still it doesn’t solve the problem. @jhultman Could you let us know how did you solve the problem?