How to move trainer from cpu to gpu after .fit #15678
Unanswered
xwinxu
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 am trying to do some evaluations that require my model be on cpu. I am trying to make
trainer.test()
run on CPU after being trained on GPU withtrainer.fit
. What's the best way to do this without needing to reload the checkpoint into the state dictionary? I am trying to avoid reloading the state dictionary because I notice I have to go through the dictionary and manually prune out the prefixes for the sub-modules of themodel
since wrapping them inside PTL adds the module names as an extra component. Thanks!Beta Was this translation helpful? Give feedback.
All reactions