Lightning with pseudolabelling iterating over extra dataloader

Hi all,

I am trying to use pseudolabelling, and wanted to repurpose some old code of mine (lightning implementation) a lot of stuff seems to have changed and I almost got it working except for the pseudo labelling step.

Here, I iterate over a seperate dataloader manually (eg: next(iter(dataloader2))and I think PyTorch complains that this one is on the cpu?

Using Pytorch Lightning version 1.9.3, wasn’t able to upgrade to 2.0 yet (dependency issues)

Hmm, ok, I solved it by going to .to(self.device)
I thought we shouldn’t do that in lightning though. So is that ok?

If you iterate manually over the dataloader, then you are responsible for moving data to the GPU, that’s right. Lightning is not involved in that at all.

It is totally fine if you want to do it this way.

1 Like