Skip to content
Advertisement

tqdm stops showing progress in terminal “… (more hidden) …”

I am training a neural network and I found it useful to have a tqdm bar showing how many steps in epoch has come.

I faced the following problem:

after reaching the end of a terminal window, it shows ... (more hidden) ... and I cannot do anything about it. I tried scrolling up and down in tmux, but it does nothing.

The connection to the Linux server is established through ssh and tmux is used inside the dedicated machine. The code for tqdm is:

pbar = tqdm(total=4500)
pbar.set_description(f'EPOCH: {epoch}')
pbar.n = *value*
pbar.update()

how it looks: screenshot

Interestingly, tho, that I couldn’t find anything connected to “… (more hidden) …” anywhere in Google.

Advertisement

Answer

This happens when there are more nested bars than lines in the terminal.

It can also happen if you forget to close() finished progress bars. Using with will make sure that the bars are closed eventually:

with tqdm(...) as pbar:
   ...
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement