Skip to content

Commit

Permalink
Merge pull request #1478 from mikel-brostrom/cpu-torch-ci-installation
Browse files Browse the repository at this point in the history
cpu torch install in CI by simply sed toml
  • Loading branch information
mikel-brostrom committed Jun 13, 2024
2 parents 34e3060 + eff4e1b commit 9423fae
Showing 1 changed file with 65 additions and 2 deletions.
67 changes: 65 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,16 @@ jobs:
- name: Install requirements
shell: bash # for Windows compatibility
run: |
python -m pip install --upgrade pip setuptools wheel
pip install poetry
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with yolo
- name: Generate detections and embeddings
Expand Down Expand Up @@ -78,8 +85,16 @@ jobs:
- name: Install requirements
shell: bash # for Windows compatibility
run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with yolo,evolve
- name: Generate detections and embeddings
Expand Down Expand Up @@ -114,8 +129,16 @@ jobs:
- name: Install requirements
shell: bash # for Windows compatibility
run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install
- name: Generate detections and embeddings
Expand All @@ -139,8 +162,16 @@ jobs:
with:
python-version: '3.11'
- run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with yolo
- name: Test tracking with pose models
env:
Expand All @@ -158,8 +189,16 @@ jobs:
with:
python-version: '3.11'
- run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with yolo
- name: Test tracking with pose models
env:
Expand All @@ -184,8 +223,16 @@ jobs:
python-version: '3.11'
- name: Install dependencies
run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with yolo
- name: Test tracking with seg models
env:
Expand All @@ -207,8 +254,16 @@ jobs:
python-version: '3.11'
- name: Install dependencies
run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with export
- name: Test export models
run: python boxmot/appearance/reid_export.py --include torchscript onnx openvino --device cpu --batch-size 3 --dynamic
Expand All @@ -232,8 +287,16 @@ jobs:
with:
python-version: '3.11'
- run: |
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
# Linux
sed -i 's/source="torch_cuda121"/source="torchcpu"/g' pyproject.toml
fi
python -m pip install --upgrade pip setuptools wheel poetry
poetry config virtualenvs.create false
poetry lock --no-update
poetry install --with test
- name: Test export models
run: python boxmot/appearance/reid_export.py --include torchscript onnx openvino --device cpu --batch-size 3 --dynamic
Expand Down

0 comments on commit 9423fae

Please sign in to comment.