mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-24 06:14:55 +08:00
Update exporter.py to raise errors on export failure (#3951)
This commit is contained in:
parent
d0a875e8e6
commit
1a8767051d
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -162,12 +162,12 @@ jobs:
|
|||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # caching pip dependencies
|
||||||
- name: Install requirements
|
- name: Install requirements
|
||||||
shell: bash # for Windows compatibility
|
shell: bash # for Windows compatibility
|
||||||
run: |
|
run: | # CoreML must be installed before export due to protobuf error from AutoInstall
|
||||||
python -m pip install --upgrade pip wheel
|
python -m pip install --upgrade pip wheel
|
||||||
if [ "${{ matrix.torch }}" == "1.8.0" ]; then
|
if [ "${{ matrix.torch }}" == "1.8.0" ]; then
|
||||||
pip install -e . torch==1.8.0 torchvision==0.9.0 pytest --extra-index-url https://download.pytorch.org/whl/cpu
|
pip install -e . torch==1.8.0 torchvision==0.9.0 pytest 'coremltools>=6.0,<=6.2' --extra-index-url https://download.pytorch.org/whl/cpu
|
||||||
else
|
else
|
||||||
pip install -e . pytest --extra-index-url https://download.pytorch.org/whl/cpu
|
pip install -e . pytest 'coremltools>=6.0,<=6.2' --extra-index-url https://download.pytorch.org/whl/cpu
|
||||||
fi
|
fi
|
||||||
- name: Check environment
|
- name: Check environment
|
||||||
run: |
|
run: |
|
||||||
|
8
.github/workflows/docker.yaml
vendored
8
.github/workflows/docker.yaml
vendored
@ -49,7 +49,6 @@ jobs:
|
|||||||
platforms: "linux/amd64"
|
platforms: "linux/amd64"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
if: github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile
|
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
@ -65,21 +64,22 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build Image
|
- name: Build Image
|
||||||
|
if: github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile
|
||||||
run: |
|
run: |
|
||||||
docker build --platform ${{ matrix.platforms }} -f docker/${{ matrix.dockerfile }} -t ultralytics/ultralytics:${{ matrix.tags }} .
|
docker build --platform ${{ matrix.platforms }} -f docker/${{ matrix.dockerfile }} -t ultralytics/ultralytics:${{ matrix.tags }} .
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
if: matrix.platforms == 'linux/amd64' # arm64 images not supported on GitHub CI runners
|
if: (github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile) && matrix.platforms == 'linux/amd64' # arm64 images not supported on GitHub CI runners
|
||||||
run: |
|
run: |
|
||||||
docker run ultralytics/ultralytics:${{ matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
|
docker run ultralytics/ultralytics:${{ matrix.tags }} /bin/bash -c "pip install pytest && pytest tests"
|
||||||
|
|
||||||
- name: Run Benchmarks
|
- name: Run Benchmarks
|
||||||
if: matrix.platforms == 'linux/amd64' # arm64 images not supported on GitHub CI runners
|
if: (github.event_name == 'push' || github.event.inputs.dockerfile == matrix.dockerfile) && matrix.platforms == 'linux/amd64' # arm64 images not supported on GitHub CI runners
|
||||||
run: |
|
run: |
|
||||||
docker run ultralytics/ultralytics:${{ matrix.tags }} yolo benchmark model=yolov8n.pt imgsz=160 verbose=0.26
|
docker run ultralytics/ultralytics:${{ matrix.tags }} yolo benchmark model=yolov8n.pt imgsz=160 verbose=0.26
|
||||||
|
|
||||||
- name: Push Image
|
- name: Push Image
|
||||||
if: github.event_name == 'push' || github.event.inputs.push == true
|
if: github.event_name == 'push' || (github.event.inputs.dockerfile == matrix.dockerfile && github.event.inputs.push == true)
|
||||||
run: |
|
run: |
|
||||||
docker push ultralytics/ultralytics:${{ matrix.tags }}
|
docker push ultralytics/ultralytics:${{ matrix.tags }}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ def try_export(inner_func):
|
|||||||
return f, model
|
return f, model
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.info(f'{prefix} export failure ❌ {dt.t:.1f}s: {e}')
|
LOGGER.info(f'{prefix} export failure ❌ {dt.t:.1f}s: {e}')
|
||||||
return None, None
|
raise e
|
||||||
|
|
||||||
return outer_func
|
return outer_func
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user