"""日志:tqdm / tensorboard""" from tqdm import tqdm class ProgressBar: """进度条""" def __init__(self, total, desc=""): self.pbar = tqdm(total=total, desc=desc) def update(self, n=1): """更新进度""" self.pbar.update(n) def close(self): """关闭进度条""" self.pbar.close()