glenn-jocher commited on
Commit
cdb678f
1 Parent(s): b40dd99

Update yolo.py (#2899)

Browse files
Files changed (1) hide show
  1. models/yolo.py +6 -6
models/yolo.py CHANGED
@@ -264,14 +264,14 @@ if __name__ == '__main__':
264
  # Create model
265
  model = Model(opt.cfg).to(device)
266
  model.train()
267
-
268
  # Profile
269
- # img = torch.rand(8 if torch.cuda.is_available() else 1, 3, 640, 640).to(device)
270
  # y = model(img, profile=True)
271
 
272
- # Tensorboard
273
  # from torch.utils.tensorboard import SummaryWriter
274
- # tb_writer = SummaryWriter()
275
- # print("Run 'tensorboard --logdir=models/runs' to view tensorboard at http://localhost:6006/")
276
- # tb_writer.add_graph(model.model, img) # add model to tensorboard
277
  # tb_writer.add_image('test', img[0], dataformats='CWH') # add model to tensorboard
 
264
  # Create model
265
  model = Model(opt.cfg).to(device)
266
  model.train()
267
+
268
  # Profile
269
+ # img = torch.rand(8 if torch.cuda.is_available() else 1, 3, 320, 320).to(device)
270
  # y = model(img, profile=True)
271
 
272
+ # Tensorboard (not working https://github.com/ultralytics/yolov5/issues/2898)
273
  # from torch.utils.tensorboard import SummaryWriter
274
+ # tb_writer = SummaryWriter('.')
275
+ # print("Run 'tensorboard --logdir=models' to view tensorboard at http://localhost:6006/")
276
+ # tb_writer.add_graph(torch.jit.trace(model, img, strict=False), []) # add model graph
277
  # tb_writer.add_image('test', img[0], dataformats='CWH') # add model to tensorboard