From 5e76af4f1c999ccb1b66a4011cefc4db20421998 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sun, 19 Dec 2021 22:14:13 +0100 Subject: [PATCH 01/26] CI: add py3.10 & default py3.8 --- .github/workflows/ci_install-pkg.yml | 4 ++-- .github/workflows/ci_test-base.yml | 2 +- .github/workflows/ci_test-full.yml | 6 +++--- .github/workflows/code-format.yml | 2 +- .github/workflows/release-pypi.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_install-pkg.yml b/.github/workflows/ci_install-pkg.yml index 2d791ec9e5c..71152ad3d3d 100644 --- a/.github/workflows/ci_install-pkg.yml +++ b/.github/workflows/ci_install-pkg.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Check package run: | @@ -41,7 +41,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, macOS-10.15 , windows-2019] - python-version: [3.7] + python-version: [3.8] timeout-minutes: 10 steps: diff --git a/.github/workflows/ci_test-base.yml b/.github/workflows/ci_test-base.yml index 43a0ad05021..576028889c9 100644 --- a/.github/workflows/ci_test-base.yml +++ b/.github/workflows/ci_test-base.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, windows-2019, macOS-10.15] - python-version: [3.7] + python-version: [3.8] env: PYTEST_ARTEFACT: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 6106cc0449d..4f5a605ed87 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -28,11 +28,11 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, macOS-10.15, windows-2019] - python-version: [3.6, 3.8, 3.9] + python-version: ["3.6", "3.8", "3.10"] requires: ['oldest', 'latest'] exclude: - - {python-version: 3.6, requires: 'latest'} - - {python-version: 3.9, requires: 'oldest'} + - {python-version: "3.6", requires: 'latest'} + - {python-version: "3.10", requires: 'oldest'} env: PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 077c0beecff..e9b92741b69 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@master - uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies run: | pip install flake8 diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index 03af9e75ccb..a1038203424 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Install dependencies run: >- From c88bb0b1a793f4ed53e968fb4bbe79a0943d6a9b Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 15:45:26 +0100 Subject: [PATCH 02/26] np 1.21 --- .github/workflows/ci_test-full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 4f5a605ed87..ddb0baba0a0 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -77,7 +77,7 @@ jobs: - name: Freeze Numpy (hotfix) if: matrix.requires == 'latest' run: | - pip install -q "numpy==1.20.0" # temp fix for cypesq + pip install -q "numpy==1.21.0" # temp fix for cypesq # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision From 65f36531b6993669321d8c8da3ff51427154e2d1 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 16:41:23 +0100 Subject: [PATCH 03/26] openblas --- .github/workflows/ci_test-full.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index ddb0baba0a0..75f28fd3506 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -52,7 +52,8 @@ jobs: - name: Setup macOS if: runner.os == 'macOS' run: | - brew install gcc libomp ffmpeg # https://github.com/pytorch/pytorch/issues/20030 + # https://github.com/pytorch/pytorch/issues/20030 + brew install gcc libomp ffmpeg openblas - name: Setup Linux if: runner.os == 'Linux' run: | From d9faf737ebdc6b95e11f75679a9f16be4dc92b52 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 17:12:38 +0100 Subject: [PATCH 04/26] :all: --- .github/workflows/ci_test-full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 75f28fd3506..244fab39daf 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -78,7 +78,7 @@ jobs: - name: Freeze Numpy (hotfix) if: matrix.requires == 'latest' run: | - pip install -q "numpy==1.21.0" # temp fix for cypesq + pip install -q "numpy==1.21.0" --only-binary :all: # temp fix for cypesq # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision From 0bb07b8202f579b61ccb3cc18db9b81d1dc7d7c2 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 17:19:00 +0100 Subject: [PATCH 05/26] rev --- .github/workflows/ci_test-full.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 244fab39daf..0a4e0f8ab44 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -64,6 +64,13 @@ jobs: run: | choco install ffmpeg + - name: Freeze Numpy (hotfix) + if: matrix.requires == 'latest' + run: | + pip install -q "numpy==1.21.0" # temp fix for cypesq + # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ + pip install -q "Pillow<9.0" # It messes with torchvision + - uses: ./.github/actions/caching with: os: ${{ runner.os }} @@ -75,13 +82,6 @@ jobs: pip --version pip install --requirement requirements.txt --upgrade --find-links $PYTORCH_URL - - name: Freeze Numpy (hotfix) - if: matrix.requires == 'latest' - run: | - pip install -q "numpy==1.21.0" --only-binary :all: # temp fix for cypesq - # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ - pip install -q "Pillow<9.0" # It messes with torchvision - - name: Install all dependencies run: | python ./requirements/adjust-versions.py requirements.txt From 09288918cc564f3273705cc1163af533f3c78836 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 17:27:43 +0100 Subject: [PATCH 06/26] * --- .github/workflows/ci_test-full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 0a4e0f8ab44..c190c26292e 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -67,7 +67,7 @@ jobs: - name: Freeze Numpy (hotfix) if: matrix.requires == 'latest' run: | - pip install -q "numpy==1.21.0" # temp fix for cypesq + pip install -q "numpy==1.21.*" # temp fix for cypesq # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision From 88fcaaa7014685bc087e27f417cd0e7e02e43ec4 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 17:45:31 +0100 Subject: [PATCH 07/26] reinstall --- .github/workflows/ci_test-full.yml | 5 +++-- requirements/audio_test.txt | 2 +- torchmetrics/utilities/imports.py | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index c190c26292e..04906860858 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -64,10 +64,10 @@ jobs: run: | choco install ffmpeg - - name: Freeze Numpy (hotfix) + - name: Freeze Numpy/PIL (hotfix) if: matrix.requires == 'latest' run: | - pip install -q "numpy==1.21.*" # temp fix for cypesq + # pip install -q "numpy==1.20.0" # temp fix for cypesq # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision @@ -87,6 +87,7 @@ jobs: python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt pip install --requirement requirements/devel.txt --upgrade --find-links $PYTORCH_URL + pip install --force-reinstall pypesq pip list - name: Pull testing data from S3 diff --git a/requirements/audio_test.txt b/requirements/audio_test.txt index 8b9fa30e394..e743a3b43c1 100644 --- a/requirements/audio_test.txt +++ b/requirements/audio_test.txt @@ -1,3 +1,3 @@ -pypesq +pypesq>=1.2 mir_eval>=0.6 speechmetrics @ https://github.com/aliutkus/speechmetrics/archive/refs/heads/master.zip diff --git a/torchmetrics/utilities/imports.py b/torchmetrics/utilities/imports.py index 29e596717d6..3c6e4b32c88 100644 --- a/torchmetrics/utilities/imports.py +++ b/torchmetrics/utilities/imports.py @@ -107,7 +107,6 @@ def _compare_version(package: str, op: Callable, version: str) -> Optional[bool] _SCIPY_AVAILABLE: bool = _package_available("scipy") _TORCH_FIDELITY_AVAILABLE: bool = _package_available("torch_fidelity") _LPIPS_AVAILABLE: bool = _package_available("lpips") -_PYCOCOTOOLS_AVAILABLE: bool = _package_available("pycocotools") _TORCHVISION_AVAILABLE: bool = _package_available("torchvision") _TORCHVISION_GREATER_EQUAL_0_8: Optional[bool] = _compare_version("torchvision", operator.ge, "0.8.0") _TQDM_AVAILABLE: bool = _package_available("tqdm") From 47ca0a375dd24958d00d8623a83ef62284d3b8b9 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 17:51:03 +0100 Subject: [PATCH 08/26] > --- requirements/audio_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/audio_test.txt b/requirements/audio_test.txt index e743a3b43c1..acb3429375f 100644 --- a/requirements/audio_test.txt +++ b/requirements/audio_test.txt @@ -1,3 +1,3 @@ -pypesq>=1.2 +pypesq>1.2 mir_eval>=0.6 speechmetrics @ https://github.com/aliutkus/speechmetrics/archive/refs/heads/master.zip From fca29b99869d089d621e2a75d8f2d56375623a33 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 18:08:26 +0100 Subject: [PATCH 09/26] pil --- .github/workflows/ci_test-full.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 04906860858..d3d051e467a 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -64,10 +64,9 @@ jobs: run: | choco install ffmpeg - - name: Freeze Numpy/PIL (hotfix) + - name: Freeze PIL (hotfix) if: matrix.requires == 'latest' run: | - # pip install -q "numpy==1.20.0" # temp fix for cypesq # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision From 7e74a3645b19fb78e7375037052d6a57c23a850b Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 18:32:26 +0100 Subject: [PATCH 10/26] 3.7 --- .github/workflows/ci_test-full.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index d3d051e467a..11ba1df5979 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -28,10 +28,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, macOS-10.15, windows-2019] - python-version: ["3.6", "3.8", "3.10"] + python-version: ["3.7", "3.8", "3.10"] requires: ['oldest', 'latest'] exclude: - - {python-version: "3.6", requires: 'latest'} + - {python-version: "3.7", requires: 'latest'} - {python-version: "3.10", requires: 'oldest'} env: PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml From d3f97ca7fc33654e5dbf26166ed1ac435c33f8a2 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 18:35:13 +0100 Subject: [PATCH 11/26] 3.9 --- .github/workflows/ci_test-base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-base.yml b/.github/workflows/ci_test-base.yml index 576028889c9..b932f251177 100644 --- a/.github/workflows/ci_test-base.yml +++ b/.github/workflows/ci_test-base.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, windows-2019, macOS-10.15] - python-version: [3.8] + python-version: [3.9] env: PYTEST_ARTEFACT: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html From abb2b2ade67f1334387b0936daa918e3ac9dca76 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 19:12:41 +0100 Subject: [PATCH 12/26] pil --- .github/workflows/ci_test-full.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 11ba1df5979..45be7e398c1 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -64,18 +64,17 @@ jobs: run: | choco install ffmpeg - - name: Freeze PIL (hotfix) - if: matrix.requires == 'latest' - run: | - # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ - pip install -q "Pillow<9.0" # It messes with torchvision - - uses: ./.github/actions/caching with: os: ${{ runner.os }} requires: ${{ matrix.requires }} python-version: ${{ matrix.python-version }} + - name: Freeze PIL (hotfix) + run: | + # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ + pip install -q "Pillow<9.0" # It messes with torchvision + - name: Install base dependencies run: | pip --version From f1570cf0aba96a63a16f5f199d5a4657c3af9dea Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 19:52:22 +0100 Subject: [PATCH 13/26] numba --- .github/workflows/ci_test-full.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 45be7e398c1..ad556b16886 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -70,10 +70,14 @@ jobs: requires: ${{ matrix.requires }} python-version: ${{ matrix.python-version }} + - name: Freeze NumPY (hotfix) + if: matrix.requires == 'latest' + # ImportError: Numba needs NumPy 1.21 or less + run: pip install -q "numpy==1.21.*" + - name: Freeze PIL (hotfix) - run: | - # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ - pip install -q "Pillow<9.0" # It messes with torchvision + # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ + run: pip install -q "Pillow<9.0" # It messes with torchvision - name: Install base dependencies run: | From 75da83795ad58e303f33bd925b66421f1e3ecab1 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 21:05:30 +0100 Subject: [PATCH 14/26] np --- .github/workflows/ci_test-full.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index ad556b16886..984d087d8b8 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -73,7 +73,7 @@ jobs: - name: Freeze NumPY (hotfix) if: matrix.requires == 'latest' # ImportError: Numba needs NumPy 1.21 or less - run: pip install -q "numpy==1.21.*" + run: echo "PIP_NUMPY=numpy==1.21.*" >> $GITHUB_ENV - name: Freeze PIL (hotfix) # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ @@ -88,7 +88,7 @@ jobs: run: | python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt - pip install --requirement requirements/devel.txt --upgrade --find-links $PYTORCH_URL + pip install --requirement requirements/devel.txt "$PIP_NUMPY" --upgrade --find-links $PYTORCH_URL pip install --force-reinstall pypesq pip list From 7cf8f309b17e8c8636e6f10da327315b9330f89f Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 21:12:45 +0100 Subject: [PATCH 15/26] env --- .github/workflows/ci_test-full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 984d087d8b8..ac7552cf8b7 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -88,7 +88,7 @@ jobs: run: | python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt - pip install --requirement requirements/devel.txt "$PIP_NUMPY" --upgrade --find-links $PYTORCH_URL + pip install --requirement requirements/devel.txt $PIP_NUMPY --upgrade --find-links $PYTORCH_URL pip install --force-reinstall pypesq pip list From 8b0c58b7b880490551aa1c2f1e8680802f855d33 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 21:56:14 +0100 Subject: [PATCH 16/26] numba --- .github/workflows/ci_test-full.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index ac7552cf8b7..225a9a3ca88 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -70,10 +70,10 @@ jobs: requires: ${{ matrix.requires }} python-version: ${{ matrix.python-version }} - - name: Freeze NumPY (hotfix) + - name: Freeze Numba (hotfix) if: matrix.requires == 'latest' # ImportError: Numba needs NumPy 1.21 or less - run: echo "PIP_NUMPY=numpy==1.21.*" >> $GITHUB_ENV + run: echo "PIP_NUMBA=numpy==1.21.* numba==0.55.*" >> $GITHUB_ENV - name: Freeze PIL (hotfix) # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ @@ -88,7 +88,7 @@ jobs: run: | python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt - pip install --requirement requirements/devel.txt $PIP_NUMPY --upgrade --find-links $PYTORCH_URL + pip install --requirement requirements/devel.txt $PIP_NUMBA --upgrade --find-links $PYTORCH_URL pip install --force-reinstall pypesq pip list From 1e54df8db92813ece0fe86af8e05bb1bc109d905 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 23:26:48 +0100 Subject: [PATCH 17/26] force --- .github/workflows/ci_test-full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 225a9a3ca88..e26ab9f826d 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -89,7 +89,7 @@ jobs: python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt pip install --requirement requirements/devel.txt $PIP_NUMBA --upgrade --find-links $PYTORCH_URL - pip install --force-reinstall pypesq + pip install --force-reinstall pypesq $PIP_NUMBA -r requirements.txt pip list - name: Pull testing data from S3 From 702072e48e5ff07131fe65d79c73796492755e84 Mon Sep 17 00:00:00 2001 From: Jirka Date: Fri, 11 Mar 2022 23:52:01 +0100 Subject: [PATCH 18/26] upgrade --- .github/workflows/ci_test-full.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index e26ab9f826d..6dacafed896 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -31,8 +31,9 @@ jobs: python-version: ["3.7", "3.8", "3.10"] requires: ['oldest', 'latest'] exclude: - - {python-version: "3.7", requires: 'latest'} + - {python-version: "3.8", requires: 'oldest'} - {python-version: "3.10", requires: 'oldest'} + - {python-version: "3.7", requires: 'latest'} env: PYTEST_ARTEFACT: test-results-${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml PYTORCH_URL: https://download.pytorch.org/whl/cpu/torch_stable.html @@ -89,7 +90,7 @@ jobs: python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt pip install --requirement requirements/devel.txt $PIP_NUMBA --upgrade --find-links $PYTORCH_URL - pip install --force-reinstall pypesq $PIP_NUMBA -r requirements.txt + pip install --force-reinstall pypesq --upgrade-strategy only-if-needed pip list - name: Pull testing data from S3 From cbd22126730650558923e86e058d529fbdd39d78 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 12 Mar 2022 07:34:00 +0100 Subject: [PATCH 19/26] resampy --- .github/workflows/ci_test-full.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 6dacafed896..cba463be036 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -71,14 +71,12 @@ jobs: requires: ${{ matrix.requires }} python-version: ${{ matrix.python-version }} - - name: Freeze Numba (hotfix) - if: matrix.requires == 'latest' - # ImportError: Numba needs NumPy 1.21 or less - run: echo "PIP_NUMBA=numpy==1.21.* numba==0.55.*" >> $GITHUB_ENV - - - name: Freeze PIL (hotfix) - # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ - run: pip install -q "Pillow<9.0" # It messes with torchvision + - name: Freeze Numba/PIL (hotfix) + run: | + # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ + pip install -q "Pillow<9.0" # It messes with torchvision + # ImportError: Numba needs NumPy 1.21 or less + [[ ${{ matrix.requires }} == 'latest' ]] && echo "PIP_NUMBA=numpy==1.21.* numba==0.55.*" || echo "PIP_NUMBA=numpy==1.20.*" >> $GITHUB_ENV - name: Install base dependencies run: | @@ -90,7 +88,7 @@ jobs: python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt pip install --requirement requirements/devel.txt $PIP_NUMBA --upgrade --find-links $PYTORCH_URL - pip install --force-reinstall pypesq --upgrade-strategy only-if-needed + pip install --force-reinstall pypesq resampy $PIP_NUMBA --upgrade-strategy only-if-needed pip list - name: Pull testing data from S3 From 934fd39ee719d17e6b5049ea33659ee27efeba69 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 12 Mar 2022 09:12:04 +0100 Subject: [PATCH 20/26] src --- .github/workflows/ci_test-full.yml | 9 ++++++--- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index cba463be036..ce0c545c650 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -76,7 +76,10 @@ jobs: # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision # ImportError: Numba needs NumPy 1.21 or less - [[ ${{ matrix.requires }} == 'latest' ]] && echo "PIP_NUMBA=numpy==1.21.* numba==0.55.*" || echo "PIP_NUMBA=numpy==1.20.*" >> $GITHUB_ENV + if [[ ${{ matrix.python-version }} == '3.10' ]]; then + pip install -U "numpy==1.20.0" --no-cache-dir --no-binary :all: + fi + echo "PIP_NUMPY=numpy==1.20.0" >> $GITHUB_ENV - name: Install base dependencies run: | @@ -87,8 +90,8 @@ jobs: run: | python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt - pip install --requirement requirements/devel.txt $PIP_NUMBA --upgrade --find-links $PYTORCH_URL - pip install --force-reinstall pypesq resampy $PIP_NUMBA --upgrade-strategy only-if-needed + pip install --requirement requirements/devel.txt $PIP_NUMPY --upgrade --find-links $PYTORCH_URL + pip install --force-reinstall pypesq resampy $PIP_NUMPY --no-cache-dir pip list - name: Pull testing data from S3 diff --git a/requirements.txt b/requirements.txt index 5d7a0bc464d..d792d979200 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy>=1.17.2 +numpy>1.17.2 torch>=1.3.1 pyDeprecate==0.3.* packaging From 6535787b18d807fdc6d4cf3106a7ba93e6228625 Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 12 Mar 2022 12:24:27 +0100 Subject: [PATCH 21/26] ... --- .github/workflows/ci_test-full.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index ce0c545c650..f41a16bada4 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -84,14 +84,14 @@ jobs: - name: Install base dependencies run: | pip --version - pip install --requirement requirements.txt --upgrade --find-links $PYTORCH_URL + pip install --requirement requirements.txt $PIP_NUMPY --upgrade --find-links $PYTORCH_URL - name: Install all dependencies run: | python ./requirements/adjust-versions.py requirements.txt python ./requirements/adjust-versions.py requirements/image.txt pip install --requirement requirements/devel.txt $PIP_NUMPY --upgrade --find-links $PYTORCH_URL - pip install --force-reinstall pypesq resampy $PIP_NUMPY --no-cache-dir + pip install --force-reinstall pypesq $PIP_NUMPY --no-cache-dir --no-binary :pypesq: --no-cache-dir pip list - name: Pull testing data from S3 From b88485924071cde9fa098c0ec57942acd4f5f7bf Mon Sep 17 00:00:00 2001 From: Jirka Date: Sat, 12 Mar 2022 12:51:01 +0100 Subject: [PATCH 22/26] * --- .github/workflows/ci_test-full.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index f41a16bada4..2c0cb0d3be6 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -77,9 +77,9 @@ jobs: pip install -q "Pillow<9.0" # It messes with torchvision # ImportError: Numba needs NumPy 1.21 or less if [[ ${{ matrix.python-version }} == '3.10' ]]; then - pip install -U "numpy==1.20.0" --no-cache-dir --no-binary :all: + pip install -U "numpy==1.20.*" --no-cache-dir --no-binary :all: fi - echo "PIP_NUMPY=numpy==1.20.0" >> $GITHUB_ENV + echo "PIP_NUMPY=numpy==1.20.*" >> $GITHUB_ENV - name: Install base dependencies run: | From e6086e9b8449165b52f5f9a28f207e4e78ff5dc8 Mon Sep 17 00:00:00 2001 From: Jirka Date: Thu, 31 Mar 2022 13:29:27 +0200 Subject: [PATCH 23/26] rev --- .github/workflows/ci_test-full.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 2c0cb0d3be6..1da12829308 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -71,15 +71,15 @@ jobs: requires: ${{ matrix.requires }} python-version: ${{ matrix.python-version }} - - name: Freeze Numba/PIL (hotfix) + - name: Freeze PIL (hotfix) run: | # import of PILLOW_VERSION which they recently removed in v9.0 in favor of __version__ pip install -q "Pillow<9.0" # It messes with torchvision # ImportError: Numba needs NumPy 1.21 or less - if [[ ${{ matrix.python-version }} == '3.10' ]]; then - pip install -U "numpy==1.20.*" --no-cache-dir --no-binary :all: - fi - echo "PIP_NUMPY=numpy==1.20.*" >> $GITHUB_ENV + #if [[ ${{ matrix.python-version }} == '3.10' ]]; then + # pip install -U "numpy==1.20.*" --no-cache-dir --no-binary :all: + #fi + #echo "PIP_NUMPY=numpy==1.20.*" >> $GITHUB_ENV - name: Install base dependencies run: | From 9412c3222f461a4db9e41d235cfd4212f101aa55 Mon Sep 17 00:00:00 2001 From: Jirka Date: Mon, 11 Apr 2022 08:45:46 +0200 Subject: [PATCH 24/26] latest --- .github/workflows/ci_test-full.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index 1da12829308..88383f41d82 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -79,7 +79,7 @@ jobs: #if [[ ${{ matrix.python-version }} == '3.10' ]]; then # pip install -U "numpy==1.20.*" --no-cache-dir --no-binary :all: #fi - #echo "PIP_NUMPY=numpy==1.20.*" >> $GITHUB_ENV + echo "PIP_NUMPY=numpy==1.20.*" >> $GITHUB_ENV - name: Install base dependencies run: | From c209f9c7db60427c67ca5b1dd16d761212bd691b Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Mon, 11 Jul 2022 17:06:02 +0200 Subject: [PATCH 25/26] Apply suggestions from code review --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d4635498007..9a261af9d0a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -numpy>1.17.2 +numpy>=1.17.2 torch>=1.3.1 packaging typing-extensions; python_version < '3.9' From 4cf373ef8d67e2a4e94cf3a1c0ede32312a9696e Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Mon, 11 Jul 2022 17:09:47 +0200 Subject: [PATCH 26/26] Apply suggestions from code review --- src/torchmetrics/utilities/imports.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/torchmetrics/utilities/imports.py b/src/torchmetrics/utilities/imports.py index 7dc2ee294d2..3fee618bd02 100644 --- a/src/torchmetrics/utilities/imports.py +++ b/src/torchmetrics/utilities/imports.py @@ -112,6 +112,7 @@ def _compare_version(package: str, op: Callable, version: str) -> Optional[bool] _SCIPY_AVAILABLE: bool = _package_available("scipy") _TORCH_FIDELITY_AVAILABLE: bool = _package_available("torch_fidelity") _LPIPS_AVAILABLE: bool = _package_available("lpips") +_PYCOCOTOOLS_AVAILABLE: bool = _package_available("pycocotools") _TORCHVISION_AVAILABLE: bool = _package_available("torchvision") _TORCHVISION_GREATER_EQUAL_0_8: Optional[bool] = _compare_version("torchvision", operator.ge, "0.8.0") _TQDM_AVAILABLE: bool = _package_available("tqdm")