XML export `--half` fix (#8522)
Browse filesImproved error reporting for https://github.com/ultralytics/yolov5/issues/8519
export.py
CHANGED
@@ -484,7 +484,7 @@ def run(
|
|
484 |
# Load PyTorch model
|
485 |
device = select_device(device)
|
486 |
if half:
|
487 |
-
assert device.type != 'cpu' or coreml
|
488 |
assert not dynamic, '--half not compatible with --dynamic, i.e. use either --half or --dynamic but not both'
|
489 |
model = attempt_load(weights, device=device, inplace=True, fuse=True) # load FP32 model
|
490 |
nc, names = model.nc, model.names # number of classes, class names
|
|
|
484 |
# Load PyTorch model
|
485 |
device = select_device(device)
|
486 |
if half:
|
487 |
+
assert device.type != 'cpu' or coreml, '--half only compatible with GPU export, i.e. use --device 0'
|
488 |
assert not dynamic, '--half not compatible with --dynamic, i.e. use either --half or --dynamic but not both'
|
489 |
model = attempt_load(weights, device=device, inplace=True, fuse=True) # load FP32 model
|
490 |
nc, names = model.nc, model.names # number of classes, class names
|