Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

[CI] bump pytorch to 2.0.1 (#2369)

João Gustavo A. Amorimffb0a68b856f
diff --git a/.github/actions_info.md b/.github/actions_info.md
index 1a130be37..51ad5e385 100644
--- a/.github/actions_info.md
+++ b/.github/actions_info.md
@@ -35,7 +35,7 @@ Has the inputs:
- `os`: (string, default: `ubuntu-latest`) the OS name same as supported by [gha](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners).
- `python-version`: (json list of strings, default: `'["3.10"]'`) a string with
format of a json list within strings for each python version desired.
-- `pytorch-version`: (json list of strings, default: `'["2.0.0"]'`) a string
+- `pytorch-version`: (json list of strings, default: `'["2.0.1"]'`) a string
with format of a json list within strings for each pytorch version desired.
- `pytorch-dtype`: (string, default: `float32`) the dtype used to generate
the tests with pytest.
@@ -60,7 +60,7 @@ Has the inputs:
- `os`: (string, default: `ubuntu-latest`) the OS name same as supported by [gha](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners).
- `python-version`: (json list of strings, default: `'["3.10"]'`) a string with
format of a json list within strings for each python version desired.
-- `pytorch-version`: (json list of strings, default: `'["2.0.0"]'`) a string
+- `pytorch-version`: (json list of strings, default: `'["2.0.1"]'`) a string
with format of a json list within strings for each pytorch version desired.
- `fail-fast`: (boolean, default: `false`) to set the `fail-fast` behavior on
the matrix strategy.
@@ -80,7 +80,7 @@ Has the inputs:
- `os`: (string, default: `ubuntu-latest`) the OS name same as supported by [gha](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners).
- `python-version`: (json list of strings, default: `'["3.10"]'`) a string with
format of a json list within strings for each python version desired.
-- `pytorch-version`: (json list of strings, default: `'["2.0.0"]'`) a string
+- `pytorch-version`: (json list of strings, default: `'["2.0.1"]'`) a string
with format of a json list within strings for each pytorch version desired.
- `fail-fast`: (boolean, default: `false`) to set the `fail-fast` behavior on
the matrix strategy.
diff --git a/.github/workflows/pr_test_cpu.yml b/.github/workflows/pr_test_cpu.yml
index f8217bd45..a17e24bf1 100644
--- a/.github/workflows/pr_test_cpu.yml
+++ b/.github/workflows/pr_test_cpu.yml
@@ -22,7 +22,7 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: '["3.8", "3.10"]'
- pytorch-version: '["1.9.1", "2.0.0"]'
+ pytorch-version: '["1.9.1", "2.0.1"]'
pytorch-dtype: 'float32'
tests-cpu-fp64:
@@ -31,7 +31,7 @@ jobs:
uses: ./.github/workflows/tests.yml
with:
python-version: '["3.8", "3.10"]'
- pytorch-version: '["1.9.1", "2.0.0"]'
+ pytorch-version: '["1.9.1", "2.0.1"]'
pytorch-dtype: 'float64'
test-typing:
diff --git a/.github/workflows/scheduled_test_cpu.yml b/.github/workflows/scheduled_test_cpu.yml
index 6ea40e1ca..5fed9ad60 100644
--- a/.github/workflows/scheduled_test_cpu.yml
+++ b/.github/workflows/scheduled_test_cpu.yml
@@ -22,7 +22,7 @@ jobs:
with:
os: 'Ubuntu-latest'
python-version: '["3.8", "3.9", "3.10"]'
- pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.0"]'
+ pytorch-version: '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1", "2.0.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
tests-cpu-windows:
@@ -35,7 +35,7 @@ jobs:
with:
os: 'Windows-latest'
python-version: '["3.10"]'
- pytorch-version: '["1.9.1", "2.0.0"]'
+ pytorch-version: '["1.9.1", "2.0.1"]'
pytorch-dtype: ${{ matrix.pytorch-dtype }}
tests-cpu-mac:
diff --git a/.github/workflows/scheduled_test_cpu_half.yml b/.github/workflows/scheduled_test_cpu_half.yml
index 6ae850bb8..47b3ff8b8 100644
--- a/.github/workflows/scheduled_test_cpu_half.yml
+++ b/.github/workflows/scheduled_test_cpu_half.yml
@@ -21,5 +21,5 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: '["3.8", , "3.10"]' # "3.9"
- pytorch-version: '["2.0.0"]' # '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1"]'
+ pytorch-version: '["2.0.1"]' # '["1.9.1", "1.10.2", "1.11.0", "1.12.1", "1.13.1"]'
pytorch-dtype: 'float16'
diff --git a/.github/workflows/test_tutorials.yml b/.github/workflows/test_tutorials.yml
index c1cf5a290..7cc598e99 100644
--- a/.github/workflows/test_tutorials.yml
+++ b/.github/workflows/test_tutorials.yml
@@ -8,7 +8,7 @@ on:
pytorch-version:
required: false
type: string
- default: '["2.0.0"]'
+ default: '["2.0.1"]'
os:
required: false
type: string
diff --git a/.github/workflows/test_typing.yml b/.github/workflows/test_typing.yml
index bb979c3f0..fb9c3f305 100644
--- a/.github/workflows/test_typing.yml
+++ b/.github/workflows/test_typing.yml
@@ -8,7 +8,7 @@ on:
pytorch-version:
required: false
type: string
- default: '["2.0.0"]'
+ default: '["2.0.1"]'
os:
required: false
type: string
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index d4d3e4792..a39c8f269 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -8,7 +8,7 @@ on:
pytorch-version:
required: false
type: string
- default: '["2.0.0"]'
+ default: '["2.0.1"]'
os:
required: false
type: string
diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt
index 9bf2ba01f..b34feadc3 100644
--- a/requirements/requirements-dev.txt
+++ b/requirements/requirements-dev.txt
@@ -1,6 +1,7 @@
kornia-rs==0.0.8
mypy[reports]
numpy
+onnx
opencv-python
pre-commit>=2
pydocstyle
diff --git a/test/augmentation/test_augmentation.py b/test/augmentation/test_augmentation.py
index ef7f14551..b04375ec9 100644
--- a/test/augmentation/test_augmentation.py
+++ b/test/augmentation/test_augmentation.py
@@ -54,7 +54,6 @@ from kornia.constants import Resample, pi
from kornia.geometry import transform_points
from kornia.testing import BaseTester, assert_close, default_with_one_parameter_changed
from kornia.utils import create_meshgrid
-from kornia.utils._compat import torch_version
from kornia.utils.helpers import _torch_inverse_cast
# TODO same_on_batch tests?
@@ -4063,7 +4062,6 @@ class TestRandomRGBShift:
out = aug(img)
assert out.shape == (2, 3, 4, 5)
- @pytest.mark.skipif(torch_version() == '2.0.0', reason='Not working on 2.0')
def test_onnx_export(self, device, dtype):
img = torch.rand(1, 3, 4, 5, device=device, dtype=dtype)
aug = RandomRGBShift(p=1.0).to(device)
diff --git a/test/color/test_gray.py b/test/color/test_gray.py
index 910aecd05..6c3a67bfd 100644
--- a/test/color/test_gray.py
+++ b/test/color/test_gray.py
@@ -201,7 +201,7 @@ class TestRgbToGrayscale(BaseTester):
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.rgb_to_grayscale, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.skipif(torch_version() == '2.0.0', reason='Not working on 2.0')
+ @pytest.mark.skipif(torch_version() in {'2.0.0', '2.0.1'}, reason='Not working on 2.0')
def test_dynamo(self, device, dtype, torch_optimizer):
# TODO: investigate the problem with dynamo
B, C, H, W = 2, 3, 4, 4
@@ -294,7 +294,7 @@ class TestBgrToGrayscale(BaseTester):
img = torch.ones(B, C, H, W, device=device, dtype=torch.float64, requires_grad=True)
assert gradcheck(kornia.color.bgr_to_grayscale, (img,), raise_exception=True, fast_mode=True)
- @pytest.mark.skipif(torch_version() == '2.0.0', reason='Not working on 2.0')
+ @pytest.mark.skipif(torch_version() in {'2.0.0', '2.0.1'}, reason='Not working on 2.0')
def test_dynamo(self, device, dtype, torch_optimizer):
# TODO: investigate the problem with dynamo
B, C, H, W = 2, 3, 4, 4
diff --git a/test/filters/test_canny.py b/test/filters/test_canny.py
index 38209dc40..56bdbef88 100644
--- a/test/filters/test_canny.py
+++ b/test/filters/test_canny.py
@@ -297,7 +297,7 @@ class TestCanny(BaseTester):
@pytest.mark.parametrize('kernel_size', [5, (5, 7)])
@pytest.mark.parametrize('batch_size', [1, 2])
- @pytest.mark.skipif(torch_version() == '2.0.0', reason='Not working on 2.0')
+ @pytest.mark.skipif(torch_version() in {'2.0.0', '2.0.1'}, reason='Not working on 2.0')
def test_dynamo(self, batch_size, kernel_size, device, dtype, torch_optimizer):
inpt = torch.ones(batch_size, 3, 10, 10, device=device, dtype=dtype)
op = Canny(kernel_size=kernel_size)
diff --git a/test/geometry/transform/test_imgwarp.py b/test/geometry/transform/test_imgwarp.py
index 854e86ca1..17876a4fc 100644
--- a/test/geometry/transform/test_imgwarp.py
+++ b/test/geometry/transform/test_imgwarp.py
@@ -418,7 +418,7 @@ class TestWarpPerspective:
assert_close(patch_warped, expected)
def test_dynamo(self, device, dtype, torch_optimizer):
- if dtype == torch.float64 and torch_version() == '2.0.0' and sys.platform == 'linux':
+ if dtype == torch.float64 and torch_version() in {'2.0.0', '2.0.1'} and sys.platform == 'linux':
pytest.xfail('Failling on CI on ubuntu with torch 2.0.0 for float64')
img = torch.rand(1, 2, 3, 4, device=device, dtype=dtype)
H_ab = kornia.eye_like(3, img)