【问题标题】:tqdm stops showing progress in terminal "... (more hidden) ..."tqdm 停止在终端“...(更隐藏)...”中显示进度
【发布时间】:2020-09-11 22:31:35
【问题描述】:

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

我遇到了以下问题:

到达终端窗口的末尾后,它显示... (more hidden) ...,我对此无能为力。我试着向上滚动 并在 tmux 中关闭,但它什么也不做。

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

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

它的外观: screenshot

有趣的是,我在 Google 的任何地方都找不到与“...(更隐藏)...”相关的任何内容。

【问题讨论】:

    标签: linux ssh terminal tmux tqdm


    【解决方案1】:

    当有more nested bars than lines in the terminal时会发生这种情况。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多