1. jupyter
from time import sleep from tqdm.notebook import tqdm for epoch in range(1, CFG.epoch + 1): loop = tqdm((train_loader), total = len(train_loader)) for x in loop: # x_, y_ = x[0].reshape(-1, 784), x[1] loop.set_description(f'Epoch [{epoch}/{CFG.epoch}]') loop.set_postfix(loss = 1,acc = f'{123}') sleep(0.01)
2.pycharm
from time import sleep from tqdm import tqdm for epoch in range(1, CFG.epoch + 1): loop = tqdm((train_loader), total = len(train_loader)) for x in loop: # x_, y_ = x[0].reshape(-1, 784), x[1] loop.set_description(f'Epoch [{epoch}/{CFG.epoch}]') loop.set_postfix(loss = 1,acc = f'{123}') sleep(0.01)
标签:tqdm,set,jupyter,loader,epoch,sleep,pycharm,loop From: https://www.cnblogs.com/ygxdbmx/p/16955467.html