Assert --optimize not used with cuda device (#8569)

This commit is contained in:
Colin Wong authored and GitHub committed 2022-07-15 16:01:01 +02:00
1 parent f8722b4429
commit f4b05680f8
1 file changed
+2
+2
View File
@@ -492,6 +492,8 @@ def run(
# Checks
imgsz *= 2 if len(imgsz) == 1 else 1 # expand
assert nc == len(names), f'Model class count {nc} != len(names) {len(names)}'
if optimize:
assert device.type != 'cuda', '--optimize not compatible with cuda devices, i.e. use --device cpu'
# Input
gs = int(max(model.stride)) # grid size (max stride)