Issue in fitting model and finding optimal learning rate parameter #10341
-
following is the error: NotImplementedError: `val_dataloader` must be implemented to be used with the Lightning Trainer
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-11-263e8be26564> in <module>()
3 tft,
4 train_dataloader=train_dataloader,
----> 5 val_dataloaders=val_dataloader,
6 )
11 frames
/usr/local/lib/python3.7/dist-packages/pytorch_lightning/core/hooks.py in val_dataloader(self)
590 will have an argument ``dataloader_idx`` which matches the order here.
591 """
--> 592 raise NotImplementedError("`val_dataloader` must be implemented to be used with the Lightning Trainer")
593
594 def predict_dataloader(self) -> EVAL_DATALOADERS:
NotImplementedError: `val_dataloader` must be implemented to be used with the Lightning Trainer trainer.fit(
tft,
train_dataloader=train_dataloader,
val_dataloaders=val_dataloader,
) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I think it's a problem with pytorch-lightning==1.5.0. |
Beta Was this translation helpful? Give feedback.
-
I realized that you cannot use |
Beta Was this translation helpful? Give feedback.
-
@geeksouvik @paapu88 @ilkerkesen : the Though the naming is similar, this is very different from accessing an already instantiated dataloader which you've passed to the trainer outside of the LightningModule's definition. If your model depends on the data, I'd recommend making it an input to your LightningModule constructor, and then pass that to the Trainer for |
Beta Was this translation helpful? Give feedback.
I think it's a problem with pytorch-lightning==1.5.0.
Had this problem too with code that worked before recreating my venv and the difference was version 1.5.0 release on 2. Nov.
Switched to 1.4.9 and it worked again.
Checked 1.5.0rc1 and it did not work either.