facebookresearch / facebookresearch/SlowFast
How to retrain a model
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Sorry if that sounds like a stupid question, I have trained the model using C2D 8x8, now I want to use slowfast yaml to train the model, but everytime it load the checkpoint and produce errors
[INFO: train_net.py: 255]: Load from last checkpoint.
Traceback (most recent call last):
File "tools/run_net.py", line 152, in
main()
File "tools/run_net.py", line 127, in main
train(cfg=cfg)
File "/home/hyao8934/slowfast/tools/train_net.py", line 258, in train
last_checkpoint, model, cfg.NUM_GPUS > 1, optimizer
File "/home/hyao8934/slowfast/slowfast/utils/checkpoint.py", line 238, in load_checkpoint
ms.load_state_dict(checkpoint["model_state"])
File "/home/hyao8934/anaconda3/envs/slowfast/lib/python3.7/site-packages/torch/nn/modules/module.py", line 830, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ResNet:
size mismatch for s4.pathway0_res0.branch2.a.weight: copying a param with shape torch.Size([256, 512, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 512, 3, 1, 1]).
size mismatch for s4.pathway0_res1.branch2.a.weight: copying a param with shape torch.Size([256, 1024, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 1, 1]).
size mismatch for s4.pathway0_res2.branch2.a.weight: copying a param with shape torch.Size([256, 1024, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 1, 1]).
size mismatch for s4.pathway0_res3.branch2.a.weight: copying a param with shape torch.Size([256, 1024, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 1, 1]).
size mismatch for s4.pathway0_res4.branch2.a.weight: copying a param with shape torch.Size([256, 1024, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 1, 1]).
size mismatch for s4.pathway0_res5.branch2.a.weight: copying a param with shape torch.Size([256, 1024, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 1024, 3, 1, 1]).
size mismatch for s5.pathway0_res0.branch2.a.weight: copying a param with shape torch.Size([512, 1024, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1024, 3, 1, 1]).
size mismatch for s5.pathway0_res1.branch2.a.weight: copying a param with shape torch.Size([512, 2048, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 2048, 3, 1, 1]).
size mismatch for s5.pathway0_res2.branch2.a.weight: copying a param with shape torch.Size([512, 2048, 1, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 2048, 3, 1, 1]).
Segmentation fault (core dumped)
How to switch to new yaml, clean the previous checkpoint?
Contributor guide
Assessment
This issue has not been assessed yet.