Skip to content

Pytorch-lightning is not able to load the model checkpoint #12199

Discussion options

You must be logged in to vote

hey @yashrathi-git !

your code looks correct.
Why do you think that outputs are random?
you can also validate your model after loading using:

model = LitModel.load_from_checkpoint(...)
trainer = Trainer(...)
trainer.validate(model)  # or trainer.test(model)

if the above gives you the desired metrics then the model is loaded correctly.

one more thing, you might need to call model.eval() after loading the weights from the checkpoint.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@yashrathi-git
Comment options

Answer selected by yashrathi-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants