Skip to content

How can I check which epoch is picked for the best model? #188

Answered by Linux-cpp-lisp
ssrokyz asked this question in Q&A
Discussion options

You must be logged in to vote

At the end of each epoch, the trainer checks whether the current validation metrics are better than those of the last best_model.pth. If they are, it overwrites best_model.pth and prints

! Best model     [epochnum]    [metrics_value]

to the log.

You can find out which epoch best_model.pth corresponds to by checking for the last instance of this line in the log file, something like:

cat root/run_name/log | grep "\! Best model" | tail -n 1

giving, for example,

! Best model     1872    0.001

which means best_model.pth contains the model as of epoch 1872.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ssrokyz
Comment options

@DQM520
Comment options

Answer selected by simonbatzner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants