From dfc9f4103a41a95104597c28255c04a9a17558b9 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 27 Mar 2022 20:24:08 +0200 Subject: [PATCH] `yolo.py --profile` updates --- models/yolo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/yolo.py b/models/yolo.py index fb01aaafedcf..e88db79ca8c7 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -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