mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Make wandb optional
This commit is contained in:
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user