Default FP16 TensorRT export (#6798)

* Assert engine precision #6777

* Default to FP32 inputs for TensorRT engines

* Default to FP16 TensorRT exports #6777

* Remove wrong line #6777

* Automatically adjust detect.py input precision #6777

* Automatically adjust val.py input precision #6777

* Add missing colon

* Cleanup

* Cleanup

* Remove default trt_fp16_input definition

* Experiment

* Reorder detect.py if statement to after half checks

* Update common.py

* Update export.py

* Cleanup

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
DavidBandGlenn Jocher authored and GitHub committed 2022-03-06 21:21:16 +01:00
1 parent 7e98b4801a
commit 596de6d5a0
4 files changed
+13 -3

No files matched your search

+4
View File
@@ -144,6 +144,10 @@ def run(data,
model.model.half() if half else model.model.float()
elif engine:
batch_size = model.batch_size
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
else:
half = False
batch_size = 1 # export.py models default to batch-size 1