from random import random from time import sleep from tqdm import tqdm
epochs = 2 train_data_num = 10 for i in range(epochs): with tqdm(total=train_data_num) as t: for j in range(10): # Description will be displayed on the left t.set_description('Epoch %i' % i) # Postfix will be displayed on the right, # formatted automatically based on argument's datatype t.set_postfix(loss=random(),acc=random()) sleep(0.1) t.update(1)