Skip to content

Conversation

@enolan
Copy link

@enolan enolan commented Aug 23, 2022

tqdm(enumerate(x)) doesn't let tqdm know how long x is, so the progress bar and ETA don't work. tenumerate conveys the correct information, meaning we get a nice progress bar with an ETA for our diffusions.

`tqdm(enumerate(x))` doesn't let tqdm know how long x is, so the progress bar and ETA don't work. `tenumerate` conveys the correct information.
@patrickvonplaten
Copy link
Contributor

Hey @enolan,

Would something like this work for you as well: #172 (comment) ?

@anton-l
Copy link
Member

anton-l commented Aug 24, 2022

@patrickvonplaten to fix this "undefined length" progress bar we'll need to implement #172 with kwargs+total like so:

def progress_bar(self, iterable, **kwargs):
     if self._is_progress_bar_enabled:
         return tqdm(iterable, **kwargs)
     else:
         return iterable
for i, t in tqdm(enumerate(self.scheduler.timesteps), total=self.scheduler.num_inference_steps):

Left a comment on that issue as well

@patrickvonplaten
Copy link
Contributor

Hey @enolan - thanks for the PR, I think we ideally want to follow the official tqdm docs here and simply swap enumerate(...) and tqdm(...) https://pypi.org/project/tqdm/#faq-and-known-issues as is done in #242 .

Hope it's ok to close this PR in favor of #242 :-)

@enolan
Copy link
Author

enolan commented Sep 5, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants