tqdm 停止在终端“...(更多隐藏)...”中显示进度

tqdm stops showing progress in terminal "... (more hidden) ..."

我正在训练神经网络,我发现有一个 tqdm 条显示 epoch 中的步数很有用。

我遇到了以下问题:

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.

与Linux服务器的连接是通过ssh建立的,专用机器内部使用了tmux。 tqdm 的代码是:

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

外观: screenshot

有趣的是,我在 Google.

的任何地方都找不到与“...(更隐藏)...”相关的任何内容

当有 more nested bars than lines in the terminal.

时会发生这种情况

can also happen if you forget to close()完成了进度条。使用 with 将确保柱最终关闭:

with tqdm(...) as pbar:
   ...