Make wandb optional

pull/550/head
Aman Arora 4 years ago
parent f54897cc0b
commit 5772c55c57

@ -1,3 +1,3 @@
torch>=1.4.0
torchvision>=0.5.0
pyyaml
pyyaml

@ -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)

@ -55,7 +55,7 @@ except AttributeError:
try:
import wandb
has_wandb = True
except ModuleNotFoundError:
except ImportError:
has_wandb = False
torch.backends.cudnn.benchmark = True

Loading…
Cancel
Save