Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Fix tqdm serialization #169

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions inferno/trainers/callbacks/tqdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def __init__(self, *args, **kwargs):
self.is_training = False
self.is_validation = False

def get_config(self):
config_dict = super(TQDMProgressBar, self).get_config()
config_dict.update({'epoch_bar': None})
config_dict.update({'outer_bar': None})
return config_dict

def bind_trainer(self, *args, **kwargs):
super(TQDMProgressBar, self).bind_trainer(*args, **kwargs)
self.trainer.console.toggle_progress(False)
Expand All @@ -52,6 +58,8 @@ def begin_of_fit(self, max_num_epochs, **_):
self.outer_bar = tqdm(total=max_num_epochs, position=0, dynamic_ncols=True)
else:
self.outer_bar = tqdm(total=1000, position=0, dynamic_ncols=True)

self.outer_bar.update(self.trainer._epoch_count)
self.outer_bar.set_description("Epochs")

def end_of_fit(self, **_):
Expand Down