TypeError: validation_step() missing 1 required positional argument: 'dataloader_nb' #14238
Answered
by
rohitgr7
MooreManor
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
def validation_step(self, batch, batch_nb, dataloader_nb, vis=False, save=True, mesh_save_dir=None): My pytorch-lightning version is 1.6.0, but the code is written with pytorch-lightning 1.1.8. And when I ran the code, I met the bug How can I fix it and pass parameters to |
Beta Was this translation helpful? Give feedback.
Answered by
rohitgr7
Aug 17, 2022
Replies: 1 comment
-
if you are using a single val dataloader: def validation_step(self, batch, batch_idx): if you are using multiple val dataloader: def validation_step(self, batch, batch_idx, dataloader_idx): for consistency, you can just do def validation_step(self, batch, batch_idx, dataloader_idx=0): |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
MooreManor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if you are using a single val dataloader:
if you are using multiple val dataloader:
for consistency, you can just do