Skip to content

Commit

Permalink
Assert --optimize not used with cuda device (#8569)
Browse files Browse the repository at this point in the history
  • Loading branch information
democat3457 committed Jul 15, 2022
1 parent f8722b4 commit f4b0568
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f4b0568

Please sign in to comment.