python tqdm进度条

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/TH_NUM/article/details/81978925
from tqdm import tqdm




with tqdm(total=100,
            desc='Train Epoch     #{}'.format(1),
            disable=False) as t:

        t.set_postfix({'loss': 1,
                          'accuracy': 100. * 0.1})
        t.update(1)


输出:

Train Epoch     #1:   1%|█                                                                                                              | 1/100 [00:00<00:00, 2551.28it/s, loss=1, accuracy=10]

猜你喜欢

转载自blog.csdn.net/TH_NUM/article/details/81978925