thohemp / 6DRepNet

Official Pytorch implementation of 6DRepNet: 6D Rotation representation for unconstrained head pose estimation.
MIT License
550 stars 72 forks source link

Finetuning the model #44

Closed Algabri closed 1 year ago

Algabri commented 1 year ago

I am training your model on my own data. It arrived in 19 epochs. I would like to re-run the code to continue training, but I got this error:

Traceback (most recent call last):
  File "train.py", line 124, in <module>
    model = SixDRepNet(backbone_name,
  File "/home/redhwan/2/HPE/RosNet/sixdrepnet/model.py", line 22, in __init__
    backbone.load_state_dict(ckpt)
  File "/home/redhwan/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1223, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for RepVGG:
    Missing key(s) in state_dict: "stage0.se.down.weight", "stage0.se.down.bias", "stage0.se.up.weight", "stage0.se.up.bias", "stage0.rbr_reparam.weight",....

I replaced it RepVGG-B1g2-train.pth by 300W_LP_epoch_19.pth after converting. So, I change deploy=True,

 backbone_name = 'RepVGG-B1g2' 
    # backbone_file = 'RepVGG-D2se-200epochs-train.pth'
    backbone_file = '300W_LP_epoch_19.pth'
    model = SixDRepNet(backbone_name,
                       backbone_file,
                       deploy=True,
                       pretrained=True)

Your help, please.

Shohruh72 commented 8 months ago

Hello there, How did you solve this problem, I have the same problem in the inferencing demo.py. I trained the model with 300W_LP data set and then tried to use demo.py but I got a problem with model loading.

Screenshot from 2024-02-20 09-23-26