glenn-jocher commited on
Commit
c215e87
·
unverified ·
1 Parent(s): 63ba0cb

XML export `--half` fix (#8522)

Browse files

Improved error reporting for https://github.com/ultralytics/yolov5/issues/8519

Files changed (1) hide show
  1. export.py +1 -1
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 or xml, '--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
 
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