Trainer: how to apply a method on a dataloader #14243
Unanswered
quentinblampey
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 have a method that creates a
tensor
based on one mini-batch of data, let's call itmodel.transform
.I want to transform every batch of a dataloader named
loader
and concatenate all the resulting tensor (with a progress bar showing how many batch we have processed).Of course, I could easily do it myself, but I'm looking for a one-liner that uses pytorch lightning.
For that, I could use
trainer.predict
and implementmodel.predict_step
as described on the first line. It does exactly what I want (well, actually, except for the concatenation). The real problem is that I want to be able to use different transformations, but we only have onemodel.predict_step
function.Beta Was this translation helpful? Give feedback.
All reactions