Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about train #48

Open
a13483685 opened this issue Jul 23, 2020 · 1 comment
Open

about train #48

a13483685 opened this issue Jul 23, 2020 · 1 comment

Comments

@a13483685
Copy link

Thanks for your code sharing,when I run
python train.py --dataset ucf101-24 --data_cfg cfg/ucf24.data --cfg_file cfg/ucf24.cfg --n_classes 24 --backbone_3d resnext101 --backbone_2d darknet --backbone_2d_weights weights/yolo.weights - -resume_path weights/yowo_ucf101-24_16f_best.pth
shown in terminal

RuntimeError: Error(s) in loading state_dict for YOWO:
        Missing key(s) in state_dict: "backbone_2d.models.0.conv1.weight", "backbone_2d.models.0.bn1.weight",
@usamahjundia
Copy link

i would suggest loading the state dict and print the keys of the weights. Most probably since the authors used multigpu training (dataparallel module) , the pretrained weights keys have something like "module." prepended to the keys. Probably the less hacky way to do this is to use the same dataparallel module.

I think for your case, you can just load the state dict, iterate over the keys and values, and write another state dict with the corrected keys. THen you load the corrected state dict. This is a bit hacky but it worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants