@@ -773,7 +773,7 @@ def training_step(self, batch, batch_idx):
773
773
774
774
model = TroubledModel ()
775
775
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
776
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback ], max_epochs = 5 , logger = False )
776
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback ], max_epochs = 5 , logger = False , enable_progress_bar = False )
777
777
with pytest .raises (RuntimeError , match = "Trouble!" ):
778
778
trainer .fit (model )
779
779
print (os .listdir (tmp_path ))
@@ -789,7 +789,7 @@ def validation_step(self, batch, batch_idx):
789
789
model = TroubledModel ()
790
790
epoch_length = 64
791
791
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
792
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback ], max_epochs = 5 , logger = False )
792
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback ], max_epochs = 5 , logger = False , enable_progress_bar = False )
793
793
with pytest .raises (RuntimeError , match = "Trouble!" ):
794
794
trainer .fit (model )
795
795
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -804,7 +804,7 @@ def on_train_batch_start(self, trainer, pl_module, batch, batch_idx):
804
804
805
805
model = BoringModel ()
806
806
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
807
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainBatchStart ()], max_epochs = 5 , logger = False )
807
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainBatchStart ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
808
808
with pytest .raises (RuntimeError , match = "Trouble!" ):
809
809
trainer .fit (model )
810
810
assert os .path .isfile (tmp_path / "step=1.ckpt" )
@@ -819,7 +819,7 @@ def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx):
819
819
820
820
model = BoringModel ()
821
821
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
822
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainBatchEnd ()], max_epochs = 5 , logger = False )
822
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainBatchEnd ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
823
823
with pytest .raises (RuntimeError , match = "Trouble!" ):
824
824
trainer .fit (model )
825
825
@@ -836,7 +836,7 @@ def on_train_epoch_start(self, trainer, pl_module):
836
836
model = BoringModel ()
837
837
epoch_length = 64
838
838
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
839
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainEpochStart ()], max_epochs = 5 , logger = False )
839
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainEpochStart ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
840
840
with pytest .raises (RuntimeError , match = "Trouble!" ):
841
841
trainer .fit (model )
842
842
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -852,7 +852,7 @@ def on_train_epoch_end(self, trainer, pl_module):
852
852
model = BoringModel ()
853
853
epoch_length = 64
854
854
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
855
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainEpochEnd ()], max_epochs = 5 , logger = False )
855
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnTrainEpochEnd ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
856
856
with pytest .raises (RuntimeError , match = "Trouble!" ):
857
857
trainer .fit (model )
858
858
assert os .path .isfile (tmp_path / f"step={ 2 * epoch_length } .ckpt" )
@@ -868,7 +868,7 @@ def on_validation_batch_start(self, trainer, pl_module, batch, batch_idx):
868
868
model = BoringModel ()
869
869
epoch_length = 64
870
870
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
871
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationBatchStart ()], max_epochs = 5 , logger = False )
871
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationBatchStart ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
872
872
with pytest .raises (RuntimeError , match = "Trouble!" ):
873
873
trainer .fit (model )
874
874
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -884,7 +884,7 @@ def on_validation_batch_end(self, trainer, pl_module, outputs, batch, batch_idx)
884
884
model = BoringModel ()
885
885
epoch_length = 64
886
886
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
887
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationBatchEnd ()], max_epochs = 5 , logger = False )
887
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationBatchEnd ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
888
888
with pytest .raises (RuntimeError , match = "Trouble!" ):
889
889
trainer .fit (model )
890
890
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -900,7 +900,7 @@ def on_validation_epoch_start(self, trainer, pl_module):
900
900
model = BoringModel ()
901
901
epoch_length = 64
902
902
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
903
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationEpochStart ()], max_epochs = 5 , logger = False )
903
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationEpochStart ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
904
904
with pytest .raises (RuntimeError , match = "Trouble!" ):
905
905
trainer .fit (model )
906
906
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -916,7 +916,7 @@ def on_validation_epoch_end(self, trainer, pl_module):
916
916
model = BoringModel ()
917
917
epoch_length = 64
918
918
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
919
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationEpochEnd ()], max_epochs = 5 , logger = False )
919
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationEpochEnd ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
920
920
with pytest .raises (RuntimeError , match = "Trouble!" ):
921
921
trainer .fit (model )
922
922
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -931,7 +931,7 @@ def on_validation_start(self, trainer, pl_module):
931
931
model = BoringModel ()
932
932
epoch_length = 64
933
933
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
934
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationStart ()], max_epochs = 5 , logger = False )
934
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationStart ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
935
935
with pytest .raises (RuntimeError , match = "Trouble!" ):
936
936
trainer .fit (model )
937
937
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
@@ -946,7 +946,7 @@ def on_validation_end(self, trainer, pl_module):
946
946
model = BoringModel ()
947
947
epoch_length = 64
948
948
checkpoint_callback = ModelCheckpoint (dirpath = tmp_path , filename = "{step}" , save_on_exception = True , every_n_epochs = 4 )
949
- trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationEnd ()], max_epochs = 5 , logger = False )
949
+ trainer = Trainer (default_root_dir = tmp_path , callbacks = [checkpoint_callback , TroublemakerOnValidationEnd ()], max_epochs = 5 , logger = False , enable_progress_bar = False )
950
950
with pytest .raises (RuntimeError , match = "Trouble!" ):
951
951
trainer .fit (model )
952
952
assert os .path .isfile (tmp_path / f"step={ epoch_length } .ckpt" )
0 commit comments