Skip to content

Commit

Permalink
Fix zero-export handling with if any(f):
Browse files Browse the repository at this point in the history
Partial fix for #6563
  • Loading branch information
glenn-jocher authored Feb 8, 2022
1 parent 006eb40 commit fc75c4e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions export.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,14 @@ def run(data=ROOT / 'data/coco128.yaml', # 'dataset.yaml path'
f[9] = export_tfjs(model, im, file)

# 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):
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")
return f # return list of exported files/dirs


Expand Down

0 comments on commit fc75c4e

Please sign in to comment.