簡體   English   中英

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

[英]Where is this artifact in the output before each epoch coming from during training?

這確實更適合美學,但它一直在嘮叨我。 我似乎無法理解我的 jupyter 筆記本中 output 的這一部分是從哪里來的(由圖像中的紅色箭頭標記)它幾乎像口吃一樣出現在每個時代之前。

任何提示或解決方案將不勝感激。

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 / ...

謝謝你。

正如我在評論中所寫,您可以刷新緩沖區,以便在打印進度條之前打印消息。

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

您還可以使用 f 字符串縮短此行。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM