Bug in save_model function
phil0042 opened this issue · 1 comments
phil0042 commented
Hi,
the save_model function does not properly save the best checkpoint. The reason being the following two lines of code.
Line 50 in 70869e5
Line 138 in 70869e5
During training, save_model is called and loss_val contains the accuracy of the current iteration on the test set, not the loss value.
Fix:
Change the initial value of self.best_loss and modify the comparison (maybe rename self.best_loss and val_loss as well).
self.best_loss = float(0)
and if val_loss >= self.best_loss:
ebagdasa commented
yeah, makes sense, please feel free to do a PR! Thanks for noticing it!