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

pull/8562/head^2
Colin Wong 2022-07-15 09:01:01 -05:00 committed by GitHub
parent f8722b4429
commit f4b05680f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

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)