Proper way of making predictions with multi-GPUs #14040
Unanswered
marcmk6
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I implemented
predict_step
and tried to make predictions on multiple GPUs under DDP (e.g.predictions = trainer.predict(model, dataloaders=loader)
), but in the endpredictions
contains only1/N
of total data, whereN
is the number of GPUs.After observing this, I tried to override the hook
on_predict_epoch_end
, which is supposed to get results frompredict_step
, but it receives empty lists.I'm wondering what's correct way of doing this.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions