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

Missing keys when loading from checkpoint #1163

Closed
ikin5050 opened this issue Jun 12, 2023 · 3 comments
Closed

Missing keys when loading from checkpoint #1163

ikin5050 opened this issue Jun 12, 2023 · 3 comments

Comments

@ikin5050
Copy link

💡 Your Question

I have finetuned a model based on yolonas_l. When I attempt to load this model using the following code:

model = models.get( model_name='yolo_nas_l', checkpoint_path='checkpoints/yolo_nas_l/Person_ckpt_best.pth', num_classes=5 ).to(device)

I get the error message:

RuntimeError: Error(s) in loading state_dict for YoloNAS_L: Missing key(s) in state_dict: "backbone.stem.conv.branch_3x3.conv.weight", "backbone.stem.conv.branch_3x3.bn.weight", "backbone.stem.conv.branch_3x3.bn.bias", "backbone.stem.conv.branch_3x3.bn.running_mean", "backbone.stem.conv.branch_3x3.bn.running_var", "backbone.stem.conv.branch_1x1.weight", ...

Could anyone explain what I am doing wrong in loading the checkpoints here?

Versions

No response

@whittenator
Copy link

@ikin5050 I am also getting the same issue!

@nrepesh
Copy link

nrepesh commented Jun 16, 2023

@ikin5050 I am also getting the same issue.

@BloodAxe
Copy link
Contributor

Try updating SG to latest release, where we fixed the issue of loading checkpoints and retrain your model. This should go away

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

No branches or pull requests

4 participants