-
Notifications
You must be signed in to change notification settings - Fork 41
Fix tqdm serialization #169
base: master
Are you sure you want to change the base?
Conversation
anyone an opinion on merging this? |
If the deserialisation works (which @Yuyan-Li has not tested yet), sure. @DerThorsten would you have time to do a quick test? |
Let's see if @Yuyan-Li whants to contribute a test, if not I'll write one soonish |
I can test it on my system but I don't know how to write proper unittests. I could write a sample script showing that it works if that's enough. |
So I tested it and the deserialisation works. I also fixed it so that it shows the proper epoch in the bar when continuing the training.
|
The "training epoch x" bar isn't restored correctly. If you set trainer.set_max_num_iterations(800) to something larger you will notice
even though each epoch only has 391 iterations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the "training epoch x" bar is not restored corretly. after loading training will resume at iteration 0 but the bar seems to be restored at the iteration when the snapshot was saved.
This removes the TQDM bar from the serialization.
It prevents the error when saving the trainer:
TypeError: cannot serialize '_io.TextIOWrapper' object
I think the bar will be rebuilt automatically (haven't tested it yet).