From baa1cc8b95deff80205f158dc1e1e8ff97fc9460 Mon Sep 17 00:00:00 2001 From: Mark Colley <39366189+M-Colley@users.noreply.github.com> Date: Tue, 3 Nov 2026 11:28:20 +0000 Subject: [PATCH] Support torch 2.11+ and Python 3.13 and 3.14 Lift the torch<2.11 / torchvision<0.26 caps and the <3.13 Python cap. FMPose3D gives the same results on torch 2.15 as on 2.10: seeded 3D lifting differs by at most 3.9e-7 m, and the end-to-end demo image gives identical 2D keypoints and 3D poses within 1.8e-7 m. On a driver too old for the CUDA 13 wheels of torch 2.11+, torch warns and runs on the CPU; the README's PyTorch note now says so and shows how to install a CUDA 12 build first. CI: the floor job installed torch 2.4.0, which does not satisfy torch>=2.4.1, so pip replaced it with the newest allowed torch. It now installs 2.4.1, torchvision comes from the same CPU index as torch, and a new job runs torch 2.15.0 on Python 3.14. --- .github/workflows/build.yaml | 10 +++++++--- README.md | 4 ++-- pyproject.toml | 19 ++++++++++++------- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 38020b58..a18e62f0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,11 +15,15 @@ jobs: matrix: os: [ubuntu-latest] python-version: ["3.10"] - torch-version: ["2.4.0"] + torch-version: ["2.4.1"] include: - os: windows-latest - torch-version: 2.4.0 + torch-version: 2.4.1 python-version: "3.10" + # The newest torch and Python, to catch upstream breakage early. + - os: ubuntu-latest + torch-version: 2.15.0 + python-version: "3.14" runs-on: ${{ matrix.os }} @@ -43,7 +47,7 @@ jobs: run: | python -m pip install --upgrade pip setuptools wheel python -m pip install packaging==24.2 - python -m pip install torch==${{ matrix.torch-version }} --extra-index-url https://download.pytorch.org/whl/cpu + python -m pip install torch==${{ matrix.torch-version }} torchvision --extra-index-url https://download.pytorch.org/whl/cpu pip install '.[dev]' - name: Run pytest tests diff --git a/README.md b/README.md index 5037520e..bb8b3dd4 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ FMPose3D creates a 3D pose from a single 2D image. It leverages fast Flow Matchi ### Set up an environment -Make sure you have Python 3.10. The installation and demos are tested with Python 3.10. You can set this up with: +Make sure you have Python 3.10 or newer. The installation and demos are tested with Python 3.10. You can set this up with: ```bash conda create -n fmpose_3d python=3.10 conda activate fmpose_3d @@ -45,7 +45,7 @@ For the animal pipeline, install the optional DeepLabCut dependency: pip install "fmpose3d[animals]" ``` -> **PyTorch/CUDA note.** FMPose3D pins `torch>=2.4.1,<2.5` and `torchvision>=0.19.1,<0.20`, which use CUDA 12.1 wheels by default on Linux. If your driver does not support CUDA 12.1, or if you need a specific CUDA build, install PyTorch first using the matching command from [pytorch.org](https://pytorch.org/get-started/locally/), then install `fmpose3d`. +> **PyTorch/CUDA note.** FMPose3D needs `torch>=2.4.1` and `torchvision>=0.19.1`, and is tested up to torch 2.15. From torch 2.11 on, the default Linux wheels on PyPI bring a CUDA 13 runtime, which needs NVIDIA driver 580 or newer. With an older driver, torch warns that the driver is too old and runs on the CPU. On such a machine, or if you need another CUDA build, first install PyTorch from the matching index on [pytorch.org](https://pytorch.org/get-started/locally/), for example `pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126`, then install `fmpose3d`. ## Demos diff --git a/pyproject.toml b/pyproject.toml index 7809ab17..eccba5c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "fmpose3d" readme = "README.md" -requires-python = ">=3.10,<3.13" +requires-python = ">=3.10" dynamic = ["version"] license = {text = "Apache 2.0"} authors = [ @@ -20,16 +20,21 @@ classifiers = [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering :: Artificial Intelligence", ] dependencies = [ - # Capped below torch 2.11: PyPI's default Linux wheels for 2.4-2.10 bring a - # CUDA 12.x runtime, which any driver >= R525 can run. torch 2.11+ switches - # to CUDA 13 and needs an R580+ driver, so lifting this would silently break - # GPU support for users on older drivers. torchvision is paired accordingly. - "torch>=2.4.1,<2.11", - "torchvision>=0.19.1,<0.26", + # No upper bound: torch 2.15 gives the same results as 2.10. From 2.11 on, + # PyPI's default Linux wheels bring a CUDA 13 runtime, which needs an R580+ + # driver. On an older driver torch warns ("The NVIDIA driver on your + # system is too old") and runs on the CPU; installing a CUDA 12 build of + # torch first keeps the GPU (see the README). + "torch>=2.4.1", + "torchvision>=0.19.1", "timm>=1.0.0", "einops>=0.4.0", "numpy>=1.18.5",