diff --git a/requirements.txt b/requirements.txt index 251cb4a3..2d29a27c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ torch>=1.4.0 torchvision>=0.5.0 -pyyaml \ No newline at end of file +pyyaml diff --git a/timm/utils/summary.py b/timm/utils/summary.py index f6625835..9f5af9a0 100644 --- a/timm/utils/summary.py +++ b/timm/utils/summary.py @@ -30,6 +30,8 @@ def update_summary(epoch, train_metrics, eval_metrics, filename, write_header=Fa rowd = OrderedDict(epoch=epoch) rowd.update([('train_' + k, v) for k, v in train_metrics.items()]) rowd.update([('eval_' + k, v) for k, v in eval_metrics.items()]) + if log_wandb: + wandb.log(rowd) with open(filename, mode='a') as cf: dw = csv.DictWriter(cf, fieldnames=rowd.keys()) if write_header: # first iteration (epoch == 1 can't be used) diff --git a/train.py b/train.py index 02ea20ef..bf17364e 100755 --- a/train.py +++ b/train.py @@ -55,7 +55,7 @@ except AttributeError: try: import wandb has_wandb = True -except ModuleNotFoundError: +except ImportError: has_wandb = False torch.backends.cudnn.benchmark = True