one_hot to cuda #13232
Unanswered
ironv
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
one_hot to cuda
#13232
Replies: 1 comment
-
@ironv That's because |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
My simple model for a binary classification problem is shown below. When I run this code using
trainer = pl.Trainer(accelerator="gpu", ...
I need the .cuda() at the end ofone_hot
or else I get the errorRuntimeError: Input and parameter tensors are not at the same device, found input tensor at cpu and parameter tensor at cuda:0
. But when I setaccelerator=cpu
, I get an error. Is there a better way of handling this?Beta Was this translation helpful? Give feedback.
All reactions