Neural-HMM icon indicating copy to clipboard operation
Neural-HMM copied to clipboard

val_dataloader error message

Open chikiuso opened this issue 3 years ago • 3 comments

Hi, I run the train.py and it shows the following error message , may I have your help? thanks :

pytorch_lightning.utilities.exceptions.MisconfigurationException: val_dataloader must be implemented to be used with the Lightning Trainer

chikiuso avatar Jul 09 '22 12:07 chikiuso

Hello, You have not provided files for the validation set. Either set the validation_files hyperparameter in src/hparams.py or you can turn off validation of your training by adding limit_val_batches=0 in train.py as an additional parameter to pl.Trainer() around line 92.

shivammehta25 avatar Jul 11 '22 05:07 shivammehta25

Hi @shivammehta007 , I tried both the ways but still got the error message, thanks :

File "/opt/conda/lib/python3.8/site-packages/pytorch_lightning/core/hooks.py", line 599, in val_dataloader raise MisconfigurationException("val_dataloader must be implemented to be used with the Lightning Trainer") pytorch_lightning.utilities.exceptions.MisconfigurationException: val_dataloader must be implemented to be used with the Lightning Trainer

chikiuso avatar Jul 12 '22 04:07 chikiuso

Hello, could you give more details about which line raised this issue? Another reason I could think of was during the plotting but if you have already set the validation_files it should have solved it. So I am unsure about it for now.

shivammehta25 avatar Jul 28 '22 10:07 shivammehta25

So the solution for this is to copy the training file location and set limit_val_batches=0.

shivammehta25 avatar Nov 10 '22 09:11 shivammehta25