Skip to content

Commit

Permalink
Assert --optimize not used with cuda device (ultralytics#8569)
Browse files Browse the repository at this point in the history
  • Loading branch information
democat3457 authored and Clay Januhowski committed Sep 8, 2022
1 parent fd43289 commit 8080bbb
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 @@ -611,6 +611,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 8080bbb

Please sign in to comment.