Skip to content

Commit

Permalink
Automatically adjust val.py input precision ultralytics#6777
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBaldsiefen authored Mar 5, 2022
1 parent a2c7b67 commit 468b0d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion val.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def run(data,
if pt or jit:
model.model.half() if half else model.model.float()
elif engine:
assert (model.trt_fp16_input == half), 'model ' + ('requires' if model.trt_fp16_input else 'incompatible with') + ' --half'
if model.trt_fp16_input != half
LOGGER.info('model ' + ('requires' if model.trt_fp16_input else 'incompatible with') + ' --half. Adjusting automatically.')
half = model.trt_fp16_input
batch_size = model.batch_size
else:
half = False
Expand Down

0 comments on commit 468b0d5

Please sign in to comment.