Skip to content

Commit

Permalink
Disallow --dynamic when --half is passed (#7669)
Browse files Browse the repository at this point in the history
* disallow dynamic arg when half is given

* Update export.py

Co-authored-by: David Matos <david@track32.nl>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
3 people committed May 2, 2022
1 parent 1994ad9 commit bff6e51
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ def run(
device = select_device(device)
if half:
assert device.type != 'cpu' or coreml or xml, '--half only compatible with GPU export, i.e. use --device 0'
assert not dynamic, '--half not compatible with --dynamic, i.e. use either --half or --dynamic but not both'
model = attempt_load(weights, map_location=device, inplace=True, fuse=True) # load FP32 model
nc, names = model.nc, model.names # number of classes, class names

Expand Down

0 comments on commit bff6e51

Please sign in to comment.