diff --git a/tests/test_callbacks.py b/tests/test_callbacks.py index 73f115f..0069291 100644 --- a/tests/test_callbacks.py +++ b/tests/test_callbacks.py @@ -1,6 +1,6 @@ import pytest from trainers import get_trainer -from callbacks.early_stopping import EarlyStopping +from callbacks import EarlyStopping from utils.metrics import Accuracy from datasets.transformations import get_transforms from datasets.dataset import get_dataset @@ -53,10 +53,9 @@ def test_early_stopping(): early_stopping_callback = EarlyStopping(patience=2, verbose=True, monitor='val_loss', delta=0.1) trainer.train( train_loader=train_loader, - num_epochs=4, # Intentionally, one more epoch than patience as early stopping should trigger + num_epochs=3, # Intentionally, one more epoch than patience as early stopping should trigger valid_loader=test_loader, callbacks=[early_stopping_callback], - verbose=False ) assert early_stopping_callback.early_stop, "Early stopping did not trigger as expected." diff --git a/tests/test_checkpoints.py b/tests/test_checkpoints.py index c8513b3..12044d2 100644 --- a/tests/test_checkpoints.py +++ b/tests/test_checkpoints.py @@ -53,7 +53,6 @@ def test_checkpoint_functionality(): train_loader=train_loader, num_epochs=6, checkpoint_dir=checkpoint_dir, - verbose=False ) checkpoint_path = os.path.join(checkpoint_dir, 'checkpoint_epoch_5.pth') @@ -68,7 +67,6 @@ def test_checkpoint_functionality(): train_loader=train_loader, num_epochs=2, checkpoint_dir=checkpoint_dir, - verbose=False ) _, metrics_results = trainer.evaluate(test_loader, verbose=False) diff --git a/tests/test_fine_tuning_pipeline.py b/tests/test_fine_tuning_pipeline.py index 3e41aae..a23e51f 100644 --- a/tests/test_fine_tuning_pipeline.py +++ b/tests/test_fine_tuning_pipeline.py @@ -79,11 +79,11 @@ def test_fine_tuning_loop(): freeze_until_layer=CONFIG_TEST['training'].get('freeze_until_layer'), metrics=metrics ) + trainer.train( train_loader=train_loader, valid_loader=valid_loader, num_epochs=CONFIG_TEST['training']['num_epochs'], - verbose=False ) trainer.unfreeze_all_layers() @@ -99,7 +99,6 @@ def test_fine_tuning_loop(): train_loader=train_loader, valid_loader=valid_loader, num_epochs=CONFIG_TEST['training']['num_epochs'], - verbose=False ) _, metrics_results = trainer.evaluate( diff --git a/tests/test_training_pipeline.py b/tests/test_training_pipeline.py index 0976acb..ea25796 100644 --- a/tests/test_training_pipeline.py +++ b/tests/test_training_pipeline.py @@ -80,7 +80,6 @@ def test_training_loop(): train_loader=train_loader, valid_loader=valid_loader, num_epochs=CONFIG_TEST['training']['num_epochs'], - verbose=False ) _, metrics_results = trainer.evaluate( data_loader=test_loader,