graviraja / MLOps-Basics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metric not matched between in `early_stopping_callbacks` (Week 1)

wonyoungseo opened this issue · comments

Hi @graviraja ,

I found out that train.py in Week 1 throws RuntimeError while runnning.

RuntimeError: Early stopping conditioned on metric `val_loss` which is not available. 
Pass in or modify your `EarlyStopping` callback to use any of the following: 
`valid/loss_epoch`, `valid/acc`, `valid/precision_macro`, `valid/recall_macro`, 
`valid/precision_micro`, `valid/recall_micro`, `valid/f1`, `valid/loss`, `train/loss_step`, 
`train/acc_step`, `train/loss_epoch`, `train/acc_epoch`, `train/loss`, `train/acc`

"val_loss" on line 52 seems to be the reason since it does not match.

monitor="val_loss", patience=3, verbose=True, mode="min"

I believe this should be changed to "valid/loss" ?

Thanks for the amazing resource.

Hi @LucaSEO thanks for pointing it out. Fixed it.