backend="nccl" if use_gpu else "gloo")
from tabulate import tabulate
for itr in range(5):
stats = trainer.train()
formatted = tabulate([stats], headers="keys")
if itr > 0: // Get the last line of the stats.
After Change
tqdm=True)
from tabulate import tabulate
pbar = trange(5, unit="epoch")
for itr in pbar:
stats = trainer.train(info=dict(epoch_idx=itr, num_epochs=5))
pbar.set_postfix(
dict(loss_g=stats["mean_loss_g"], loss_d=stats["mean_loss_d"]))