亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在訓練期間每個時期之前的輸出中,這個工件在哪里?

在訓練期間每個時期之前的輸出中,這個工件在哪里?

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 關注
  • 106 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號