You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling trainer.test() when using fast_dev_run throws confusing error:
Traceback (most recent call last):
File "main.py", line 89, in<module>
trainer.test(test_dataloaders=test)
File "/home/ash/miniconda3/envs/tmp/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 916, intest
results = self.__test_using_best_weights(ckpt_path, test_dataloaders)
File "/home/ash/miniconda3/envs/tmp/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 927, in __test_using_best_weights
raise MisconfigurationException(
pytorch_lightning.utilities.exceptions.MisconfigurationException: ckpt_path is "best", but ModelCheckpoint is not configured to save the best model.
This happens because trainer.fit didn't generate a checkpoint and you don't provide model to trainer.test.
Therefore, it doesn't find a model to load.
This is expected behaviour but I agree the MisconfigurationException could be more explicit on what's wrong.
@tchaton Thank you for explanation. It is confusing though and it probably happens to many users. I think lightning should detect the case when fast_dev_run is set to True and either:
Throw python warning instead of exception and simply not execute testing
Raise exception that informs explicitly you shouln't call trainer.test() when using fast_dev_run
🐛 Bug
Calling trainer.test() when using fast_dev_run throws confusing error:
Please reproduce using the BoringModel
The text was updated successfully, but these errors were encountered: