Browse Source

TensorBoard `on_train_end()` speed improvements (#4605)

modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
dc13820c9d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      utils/loggers/__init__.py

+ 2
- 3
utils/loggers/__init__.py View File

@@ -131,10 +131,9 @@ class Loggers():
files = [(self.save_dir / f) for f in files if (self.save_dir / f).exists()] # filter

if self.tb:
from PIL import Image
import numpy as np
import cv2
for f in files:
self.tb.add_image(f.stem, np.asarray(Image.open(f)), epoch, dataformats='HWC')
self.tb.add_image(f.stem, cv2.imread(str(f))[..., ::-1], epoch, dataformats='HWC')

if self.wandb:
self.wandb.log({"Results": [wandb.Image(str(f), caption=f.name) for f in files]})

Loading…
Cancel
Save