mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-29 13:30:57 +08:00
enable fast_dev_run without a validation loop (#1779)
* fix val dataloader * Update evaluation_loop.py
This commit is contained in:
1 parent
88c086bbd2
commit
eeb411144f
2 files changed
+5
-1
No files matched your search
@@ -93,7 +93,7 @@ class ProgressBarBase(Callback):
|
||||
"""
|
||||
trainer = self.trainer
|
||||
total_val_batches = 0
|
||||
if trainer.fast_dev_run:
|
||||
if trainer.fast_dev_run and trainer.val_dataloaders is not None:
|
||||
total_val_batches = len(trainer.val_dataloaders)
|
||||
elif not self.trainer.disable_validation:
|
||||
is_val_epoch = (trainer.current_epoch + 1) % trainer.check_val_every_n_epoch == 0
|
||||
|
||||
@@ -360,6 +360,10 @@ class TrainerEvaluationLoopMixin(ABC):
|
||||
dataloaders = self.val_dataloaders
|
||||
max_batches = self.num_val_batches
|
||||
|
||||
# enable fast_dev_run without val loop
|
||||
if dataloaders is None:
|
||||
return
|
||||
|
||||
# cap max batches to 1 when using fast_dev_run
|
||||
if self.fast_dev_run:
|
||||
max_batches = 1
|
||||
|
||||
Reference in new issue
Block a user