|
|
|
|
|
name: CI CPU testing |
|
|
|
on: |
|
push: |
|
branches: [ master ] |
|
pull_request: |
|
|
|
branches: [ master ] |
|
schedule: |
|
- cron: '0 0 * * *' |
|
|
|
jobs: |
|
cpu-tests: |
|
|
|
runs-on: ${{ matrix.os }} |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
os: [ ubuntu-latest, macos-latest, windows-latest ] |
|
python-version: [ 3.9 ] |
|
model: [ 'yolov5n' ] |
|
|
|
|
|
timeout-minutes: 60 |
|
steps: |
|
- uses: actions/checkout@v2 |
|
- name: Set up Python ${{ matrix.python-version }} |
|
uses: actions/setup-python@v2 |
|
with: |
|
python-version: ${{ matrix.python-version }} |
|
|
|
|
|
|
|
- name: Get pip cache |
|
id: pip-cache |
|
run: | |
|
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)" |
|
|
|
- name: Cache pip |
|
uses: actions/[email protected] |
|
with: |
|
path: ${{ steps.pip-cache.outputs.dir }} |
|
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }} |
|
restore-keys: | |
|
${{ runner.os }}-${{ matrix.python-version }}-pip- |
|
|
|
|
|
- name: Install dependencies |
|
run: | |
|
python -m pip install --upgrade pip |
|
pip install -qr requirements.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html |
|
pip install -q onnx tensorflow-cpu keras==2.6.0 # wandb # extras |
|
python --version |
|
pip --version |
|
pip list |
|
shell: bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Tests workflow |
|
run: | |
|
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories |
|
d=cpu # device |
|
weights=runs/train/exp/weights/best.pt |
|
|
|
|
|
python train.py --img 64 --batch 32 --weights ${{ matrix.model }}.pt --cfg ${{ matrix.model }}.yaml --epochs 1 --device $d |
|
|
|
python val.py --img 64 --batch 32 --weights ${{ matrix.model }}.pt --device $d |
|
python val.py --img 64 --batch 32 --weights $weights --device $d |
|
|
|
python detect.py --weights ${{ matrix.model }}.pt --device $d |
|
python detect.py --weights $weights --device $d |
|
python hubconf.py |
|
|
|
python models/yolo.py --cfg ${{ matrix.model }}.yaml |
|
python models/tf.py --weights ${{ matrix.model }}.pt |
|
python export.py --weights ${{ matrix.model }}.pt --img 64 --include torchscript onnx |
|
|
|
python - <<EOF |
|
import torch |
|
|
|
EOF |
|
|
|
shell: bash |
|
|