Skip to content

Commit

Permalink
yolo.py --profile updates (ultralytics#7170)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Mar 27, 2022
1 parent 92ed249 commit 36a8467
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,11 @@ def parse_model(d, ch): # model_dict, input_channels(3)

# Create model
model = Model(opt.cfg).to(device)
model.train()

# Profile
if opt.profile:
img = torch.rand(16 if torch.cuda.is_available() else 1, 3, 640, 640).to(device)
model.eval().fuse()
img = torch.rand(8 if torch.cuda.is_available() else 1, 3, 640, 640).to(device)
y = model(img, profile=True)

# Test all models
Expand Down

0 comments on commit 36a8467

Please sign in to comment.