glenn-jocher commited on
Commit
d1182c4
1 Parent(s): 1d65e81

`check_requirements(('coremltools',))` (#4478)

Browse files

* `check_requirements(('coremltools',))`

* Update ci-testing.yml

* Update ci-testing.yml

Files changed (2) hide show
  1. .github/workflows/ci-testing.yml +2 -2
  2. export.py +1 -0
.github/workflows/ci-testing.yml CHANGED
@@ -48,7 +48,7 @@ jobs:
48
  run: |
49
  python -m pip install --upgrade pip
50
  pip install -qr requirements.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html
51
- pip install -q onnx
52
  python --version
53
  pip --version
54
  pip list
@@ -76,5 +76,5 @@ jobs:
76
 
77
  python hubconf.py # hub
78
  python models/yolo.py --cfg ${{ matrix.model }}.yaml # inspect
79
- python export.py --img 128 --batch 1 --weights ${{ matrix.model }}.pt # export
80
  shell: bash
 
48
  run: |
49
  python -m pip install --upgrade pip
50
  pip install -qr requirements.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html
51
+ pip install -q onnx onnx-simplifier coremltools # for export
52
  python --version
53
  pip --version
54
  pip list
 
76
 
77
  python hubconf.py # hub
78
  python models/yolo.py --cfg ${{ matrix.model }}.yaml # inspect
79
+ python export.py --img 128 --batch 1 --weights ${{ matrix.model }}.pt --include onnx torchscript # export
80
  shell: bash
export.py CHANGED
@@ -87,6 +87,7 @@ def export_coreml(model, img, file):
87
  # CoreML model export
88
  prefix = colorstr('CoreML:')
89
  try:
 
90
  import coremltools as ct
91
 
92
  print(f'\n{prefix} starting export with coremltools {ct.__version__}...')
 
87
  # CoreML model export
88
  prefix = colorstr('CoreML:')
89
  try:
90
+ check_requirements(('coremltools',))
91
  import coremltools as ct
92
 
93
  print(f'\n{prefix} starting export with coremltools {ct.__version__}...')