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:
1 parent
7e98b4801a
commit
596de6d5a0
4 files changed
+13
-3
No files matched your search
@@ -97,6 +97,10 @@ def run(weights=ROOT / 'yolov5s.pt', # model.pt path(s)
|
||||
half &= (pt or jit or onnx or engine) and device.type != 'cpu' # FP16 supported on limited backends with CUDA
|
||||
if pt or jit:
|
||||
model.model.half() if half else model.model.float()
|
||||
elif engine and 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
|
||||
|
||||
# Dataloader
|
||||
if webcam:
|
||||
|
||||
Reference in new issue
Block a user