Skip to content

How to save and load LightningModule whose input containing the pretrained moduel? #10037

Discussion options

You must be logged in to vote

since part of your model is inside arguments, you can randomly initialize your VAE and let the new checkpoint configure it's weights

vae = VAE()
encoder = copy.deepcopy(vae.encoder)
decoder = copy.deepcopy(vae.decoder)

model = Model.load_from_checkpoint(..., encoder=encoder, decoder=decoder) 

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@vrvrv
Comment options

@rohitgr7
Comment options

@vrvrv
Comment options

Answer selected by vrvrv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment