Trained weights stored on CPU despite the model being trained on GPU #17145
Unanswered
bavShehata
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’ve been tackling this problem for several hours but without luck.
I’m training a CNN on GPU and everything works great. However, once the model finishes training and I print the weights using
model.state_dict()
, I see the weights residing on the CPU. More perplexing is if I save the weights and then load them back to the GPU as follows and then print the weights, they are still on CPU:Here’s a reduced version of the model I’m training
What am I missing?
Beta Was this translation helpful? Give feedback.
All reactions