Skip to content

Commit b154ff6

Browse files
authored
Merge pull request #17 from ranamihir/improvements
Minor bug fix.
2 parents 543f1ad + f11c385 commit b154ff6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pytorch_common/train_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def train_model(
287287

288288
return_dict = {
289289
"model": model,
290-
"best_model": best_model if (do_evaluation and best_model) is not None else model,
290+
"best_model": best_model if (do_evaluation and best_model is not None) else model,
291291
"train_logger": train_logger,
292292
"val_logger": val_logger,
293293
"optimizer": optimizer,
@@ -840,8 +840,8 @@ def load_model(
840840
# Verify consistency of last epoch trained
841841
if epoch_trained != checkpoint["epoch"]:
842842
logger.warning(
843-
f"Mismatch between epoch specified in checkpoint path ('{epoch_trained}'), "
844-
f"epoch specified at saving time ('{checkpoint['epoch']}')."
843+
f"Mismatch between epoch specified in checkpoint path ({epoch_trained}) "
844+
f"and epoch specified at saving time ({checkpoint['epoch']})."
845845
)
846846

847847
# Load train / val loggers if provided
@@ -992,7 +992,7 @@ class EarlyStopping:
992992

993993
def __init__(
994994
self,
995-
criterion: Optional[str] = "f1",
995+
criterion: Optional[str] = "accuracy",
996996
mode: Optional[str] = None,
997997
min_delta: Optional[float] = None,
998998
patience: Optional[int] = None,

0 commit comments

Comments
 (0)