为了账号安全,请及时绑定邮箱和手机立即绑定

在训练期间每个时期之前的输出中,这个工件在哪里?

在训练期间每个时期之前的输出中,这个工件在哪里?

GCT1015 2023-04-18 15:59:18
这确实是更多的美学,但它一直在唠叨我。我似乎无法理解我的 jupyter notebook 中的这部分输出来自哪里(图中用红色箭头标记)它几乎像口吃一样出现在每个纪元之前。任何提示或解决方案将不胜感激。这是我的代码的摘录。for epoch in range(epochs):    start_time = time.time()    epochs_left = epochs - epoch    print('training model over %d epochs... There are %d epochs left...' % (epochs,epochs_left))    learning_rate = learning_rate_final + (learning_rate_...        train_loss, train_acc = 0, 0        for image_path, label in tqdm(train_list, 'training for epoch %d' % epoch):         loss_, acc = train(sess, image_path, label, learning_rate)        train_loss += loss_        train_acc += acc    train_loss, train_acc = train_loss / ...谢谢。
查看完整描述

1 回答

?
婷婷同学_

TA贡献1844条经验 获得超8个赞

正如我在评论中所写,您可以刷新缓冲区,以便在打印进度条之前打印消息。

print('training model over %d epochs... There are %d epochs left...' % (epochs,epochs_left),
      flush=True)

您还可以使用 f-strings 缩短此行。

print(f"training model over {epochs} epochs... There are {epochs_left} epochs left...",
      flush=True)


查看完整回答
反对 回复 2023-04-18
  • 1 回答
  • 0 关注
  • 65 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信