From 523eff99e2b4df400a53747f78769854e284195f Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 7 Nov 2022 19:27:55 +0100 Subject: [PATCH] Update ci.yaml (#37) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 45 ++++++++++++++++++++++++--- ultralytics/yolo/v8/classify/train.py | 2 +- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fee7dd6..dcc8165 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,5 @@ -# Ultralytics Continuous Integration (CI) GitHub Actions tests +# YOLO 🚀 by Ultralytics, GPL-3.0 license +# YOLO Continuous Integration (CI) GitHub Actions tests name: Ultralytics CI @@ -12,13 +13,28 @@ on: jobs: Tests: + timeout-minutes: 60 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ ubuntu-latest ] - python-version: [ 3.9 ] - timeout-minutes: 60 + python-version: [ '3.10' ] + model: [ yolov5n ] + include: +# - os: ubuntu-latest +# python-version: '3.7' # '3.6.8' min +# model: yolov5n +# - os: ubuntu-latest +# python-version: '3.8' +# model: yolov5n +# - os: ubuntu-latest +# python-version: '3.9' +# model: yolov5n + - os: ubuntu-latest + python-version: '3.8' # torch 1.7.0 requires python >=3.6, <=3.8 + model: yolov5n + torch: '1.7.0' # min torch version CI https://pypi.org/project/torchvision/ steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -37,11 +53,17 @@ jobs: - name: Install requirements run: | python -m pip install --upgrade pip wheel - pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu + if [ "${{ matrix.torch }}" == "1.7.0" ]; then + pip install -r requirements.txt torch==1.7.0 torchvision==0.8.1 --extra-index-url https://download.pytorch.org/whl/cpu + else + pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu + fi # pip install ultralytics (production) pip install . + shell: bash # for Windows compatibility - name: Check environment run: | + # python -c "import utils; utils.notebook_init()" echo "RUNNER_OS is ${{ runner.os }}" echo "GITHUB_EVENT_NAME is ${{ github.event_name }}" echo "GITHUB_WORKFLOW is ${{ github.workflow }}" @@ -51,7 +73,7 @@ jobs: python --version pip --version pip list - - name: Test HUB training + - name: Test pip package shell: python env: APIKEY: ${{ secrets.ULTRALYTICS_HUB_APIKEY }} @@ -64,3 +86,16 @@ jobs: # ultralytics.checks() # ultralytics.reset_model(key) # reset trained model # ultralytics.start(key) # train model + - name: Test detection + shell: bash # for Windows compatibility + run: | + echo "TODO" + - name: Test segmentation + shell: bash # for Windows compatibility + run: | + echo "TODO" + - name: Test classification + shell: bash # for Windows compatibility + run: | + echo "TODO" + # python ultralytics/yolo/v8/classify/train.py model=resnet18 data=mnist2560 epochs=1 img_size=64 diff --git a/ultralytics/yolo/v8/classify/train.py b/ultralytics/yolo/v8/classify/train.py index 527b8e4..8712d90 100644 --- a/ultralytics/yolo/v8/classify/train.py +++ b/ultralytics/yolo/v8/classify/train.py @@ -58,7 +58,7 @@ def train(cfg): if __name__ == "__main__": """ CLI usage: - python path/to/train.py epochs=10 project=PROJECT lr0=0.1 + python ultralytics/yolo/v8/classify/train.py model=resnet18 data=imagenette160 epochs=1 img_size=224 TODO: Direct cli support, i.e, yolov8 classify_train args.epochs 10