pytorch_tao.plugins.ProgressBar

class pytorch_tao.plugins.ProgressBar(*fields: Tuple[str], hardware: bool = True, interval: int = 1)

Print training or evaluation progress in terminal. If psutil and pynvml has installed, will also print cpu, memory and gpu memory usage.

Parameters
  • fields – the fields value to print

  • hardware – whether to print hardware usage

  • interval – interation interval to do the pring

Hooks

Hook Point

Logic

EPOCH_STARTED

create a new tqdm instance

ITERATION_COMPLETED(every=interval)

print to the output

import pytorch_tao as tao
from pytorch_tao.plugin import ProgressBar

model = ...
trainer = tao.Trainer()

@trainer.train()
def _train(images, targets):
    logits = model(images)
    loss = F.cross_entropy(logits, targets)
    return {"loss": loss}

trainer.use(ProgressBar("loss"), at="train")
__init__(*fields: Tuple[str], hardware: bool = True, interval: int = 1)

Methods

__init__(*fields[, hardware, interval])

after_use()

attach(engine)

set_engine(engine)

Attributes