Can't Load Nested Models from Checkpoints using load_from_checkpoint() #17689
Unanswered
malfonsoarquimea
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm dealing with a situation where I have a primary model that contains another model nested within it. The structure of my code is as follows:
When I attempt to use
PrimaryModel.load_from_checkpoint(primary_model_ckpt_path)
, an error occurs during the initialization ofNestedModel
because it can't find itsnested_model_ckpt_path
. I'm not passing this path because I'm loadingPrimaryModel
from its own checkpoint.Additionally, I've confirmed that the state dictionary from the
PrimaryModel
checkpoint contains the information formlp1
andmlp2
:I'm looking for a clean way to load the nested
NestedModel
from thePrimaryModel
checkpoint, since it contains all the necessary information for both models. Any guidance on how I should modify my code to handle this properly would be greatly appreciated.Beta Was this translation helpful? Give feedback.
All reactions