Skip to content

Commit

Permalink
Fix zero-export handling with if any(f): (ultralytics#6569)
Browse files Browse the repository at this point in the history
* Fix zero-export handling with `if any(f):`

Partial fix for ultralytics#6563

* Cleanup
  • Loading branch information
glenn-jocher committed Feb 8, 2022
1 parent d25991c commit 7c8d0c9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,13 @@ def run(data=ROOT / 'data/coco128.yaml', # 'dataset.yaml path'

# Finish
f = [str(x) for x in f if x] # filter out '' and None
LOGGER.info(f'\nExport complete ({time.time() - t:.2f}s)'
f"\nResults saved to {colorstr('bold', file.parent.resolve())}"
f"\nDetect: python detect.py --weights {f[-1]}"
f"\nPyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '{f[-1]}')"
f"\nValidate: python val.py --weights {f[-1]}"
f"\nVisualize: https://netron.app")
if any(f):
LOGGER.info(f'\nExport complete ({time.time() - t:.2f}s)'
f"\nResults saved to {colorstr('bold', file.parent.resolve())}"
f"\nDetect: python detect.py --weights {f[-1]}"
f"\nPyTorch Hub: model = torch.hub.load('ultralytics/yolov5', 'custom', '{f[-1]}')"
f"\nValidate: python val.py --weights {f[-1]}"
f"\nVisualize: https://netron.app")
return f # return list of exported files/dirs


Expand Down

0 comments on commit 7c8d0c9

Please sign in to comment.