From f58f055b85468042481a0e8f1b57646fdab948fc Mon Sep 17 00:00:00 2001 From: David Matos Date: Mon, 2 May 2022 09:55:29 +0200 Subject: [PATCH 1/2] disallow dynamic arg when half is given --- export.py | 1 + 1 file changed, 1 insertion(+) diff --git a/export.py b/export.py index d4191d80b410..08a99c84dba8 100644 --- a/export.py +++ b/export.py @@ -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 only compatible with static axes' 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 From 32064bd47e460dc53042dfd3bc28ab47aa050e4b Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 2 May 2022 08:55:51 -0700 Subject: [PATCH 2/2] Update export.py --- export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export.py b/export.py index 08a99c84dba8..7ec937c129d5 100644 --- a/export.py +++ b/export.py @@ -478,7 +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 only compatible with static axes' + 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