From 2ba2dc635d9d98b686a66946ed4cb32525db06e8 Mon Sep 17 00:00:00 2001 From: westford14 Date: Sun, 15 Sep 2024 20:28:21 +0200 Subject: [PATCH] Upgrade the required python version to python>=3.11 (#337) * Upgrade the required python version to python>=3.10 * Pinning to 3.11 and 3.12 for the python test, release, and doc versions * Responding to PR comments * fixing matrix in ga * Pinning to python 3.11 * pinning to 3.11 * upgrading to v4 codecov github action * Removing the cap on the densepose pytorch versions * updating the docs * unsetting the upper bound --------- Co-authored-by: Alex Lee --- .github/workflows/docs-latest.yml | 2 +- .github/workflows/docs-preview.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 10 +++++----- Makefile | 2 +- README.md | 2 +- docs/docs/index.md | 2 +- docs/docs/install.md | 4 ++-- pyproject.toml | 6 +++--- zamba/models/config.py | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docs-latest.yml b/.github/workflows/docs-latest.yml index f25f9a65..d415d0a9 100644 --- a/.github/workflows/docs-latest.yml +++ b/.github/workflows/docs-latest.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python and uv uses: drivendataorg/setup-python-uv-action@v1 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | diff --git a/.github/workflows/docs-preview.yml b/.github/workflows/docs-preview.yml index cab977db..de851960 100644 --- a/.github/workflows/docs-preview.yml +++ b/.github/workflows/docs-preview.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python and uv uses: drivendataorg/setup-python-uv-action@v1 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea35307b..90bf881c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Python and uv uses: drivendataorg/setup-python-uv-action@v1 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8328569c..b6784b0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Python and uv uses: drivendataorg/setup-python-uv-action@v1 with: - python-version: 3.8 + python-version: 3.11 - name: Install dependencies run: | @@ -41,7 +41,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: [3.8, 3.9] + python-version: [3.11, 3.12] steps: - if: matrix.os == 'ubuntu-latest' @@ -101,12 +101,12 @@ jobs: ZAMBA_RUN_DENSEPOSE_TESTS: 1 run: | uv pip install flit-core - # torch is alread installed, so just add the densepose extra + # torch is already installed, so just add the densepose extra uv pip install -e .[densepose] --no-build-isolation make densepose-tests - name: Upload coverage to codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml @@ -119,7 +119,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: [3.8] + python-version: [3.11, 3.12] steps: - name: Remove unused software diff --git a/Makefile b/Makefile index 7bbe886a..11589994 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) PROJECT_NAME = zamba -PYTHON_VERSION = 3.8 +PYTHON_VERSION = 3.11 PYTHON_INTERPRETER = python ifeq (, $(shell which nvidia-smi)) diff --git a/README.md b/README.md index 9c97074b..c433f9e4 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Visit https://zamba.drivendata.org/docs/ for full documentation and tutorials. First, make sure you have the prerequisites installed: -* Python 3.8 or 3.9 +* Python 3.11 or 3.12 * FFmpeg > 4.3 Then run: diff --git a/docs/docs/index.md b/docs/docs/index.md index 3ec90bfe..7e77a5a6 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -29,7 +29,7 @@ We encourage people to share their custom models trained with Zamba. If you trai First, make sure you have the prerequisites installed: -* Python 3.8 or 3.9 +* Python 3.11 or 3.12 * FFmpeg > 4.3 Then run: diff --git a/docs/docs/install.md b/docs/docs/install.md index 04389149..e8826f55 100644 --- a/docs/docs/install.md +++ b/docs/docs/install.md @@ -9,10 +9,10 @@ GPU configurations. Prerequisites: - - Python 3.8 or 3.9 + - Python 3.11 or 3.12 - FFmpeg -#### [Python](https://www.python.org/) 3.8 or 3.9 +#### [Python](https://www.python.org/) 3.11 or 3.12 We recommend [Python installation using Anaconda](https://www.anaconda.com/download/) for all platforms. For more information about how to install Anaconda, here are some useful YouTube videos of installation: diff --git a/pyproject.toml b/pyproject.toml index e6096069..452f036d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -requires-python = ">=3.8" +requires-python = ">=3.11" dependencies = [ "appdirs", "av", @@ -38,7 +38,7 @@ dependencies = [ "pytorchvideo", "scikit-learn", "tensorboard", - "thop==0.0.31.post2005241907", + "thop", "timm", "torch", "torchinfo", @@ -61,7 +61,7 @@ tests = [ "wheel", ] densepose = [ - "torch<2.1.0", # densepose broken after 2.1.0; https://github.com/facebookresearch/detectron2/issues/5110 + "torch", "detectron2 @ git+https://github.com/facebookresearch/detectron2.git", "detectron2-densepose @ git+https://github.com/facebookresearch/detectron2@main#subdirectory=projects/DensePose" ] diff --git a/zamba/models/config.py b/zamba/models/config.py index bd826381..ba28e111 100644 --- a/zamba/models/config.py +++ b/zamba/models/config.py @@ -428,7 +428,7 @@ class TrainConfig(ZambaBaseModel): data_dir: DirectoryPath = "" checkpoint: Optional[FilePath] = None scheduler_config: Optional[Union[str, SchedulerConfig]] = "default" - model_name: Optional[ModelEnum] = ModelEnum.time_distributed + model_name: Optional[ModelEnum] = ModelEnum.time_distributed.value dry_run: Union[bool, int] = False batch_size: int = 2 auto_lr_find: bool = False @@ -749,7 +749,7 @@ class PredictConfig(ZambaBaseModel): data_dir: DirectoryPath = "" filepaths: Optional[FilePath] = None checkpoint: Optional[FilePath] = None - model_name: Optional[ModelEnum] = ModelEnum.time_distributed + model_name: Optional[ModelEnum] = ModelEnum.time_distributed.value gpus: int = GPUS_AVAILABLE num_workers: int = 3 batch_size: int = 2