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

这确实是更多的美学,但它一直在唠叨我。我似乎无法理解我的 jupyter notebook 中的这部分输出来自哪里(图中用红色箭头标记)它几乎像口吃一样出现在每个纪元之前。

任何提示或解决方案将不胜感激。

http://img4.mukewang.com/643e4df00001e46d06500163.jpg

这是我的代码的摘录。


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

谢谢。


GCT1015
浏览 68回答 1
1回答

婷婷同学_

正如我在评论中所写,您可以刷新缓冲区,以便在打印进度条之前打印消息。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)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python