[PT FE] Update torch to 2.1 in GHA tests (#21391)
* [PT FE] Update torch to 2.1 in GHA tests * Adjust requirements for natten * Add upper bound * Use sys.executable
This commit is contained in:
parent
74bf3d4e38
commit
fa7a4f44b5
@ -23,4 +23,4 @@ pytest-html==4.1.1
|
|||||||
pytest-timeout==2.1.0
|
pytest-timeout==2.1.0
|
||||||
jax<=0.4.14
|
jax<=0.4.14
|
||||||
jaxlib<=0.4.14
|
jaxlib<=0.4.14
|
||||||
torch>=1.13
|
torch>=1.13,<2.2
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
-c ../../constraints.txt
|
-c ../../constraints.txt
|
||||||
|
--extra-index-url https://download.pytorch.org/whl/cpu
|
||||||
|
av
|
||||||
|
basicsr
|
||||||
|
datasets
|
||||||
|
facexlib
|
||||||
numpy
|
numpy
|
||||||
|
pandas
|
||||||
|
protobuf
|
||||||
|
pyctcdecode
|
||||||
pytest
|
pytest
|
||||||
pytest-html
|
pytest-html
|
||||||
torch<2.1
|
|
||||||
torchvision
|
|
||||||
av
|
|
||||||
transformers
|
|
||||||
timm
|
|
||||||
sacremoses
|
sacremoses
|
||||||
sentencepiece
|
sentencepiece
|
||||||
datasets
|
|
||||||
pyctcdecode
|
|
||||||
protobuf
|
|
||||||
soundfile
|
soundfile
|
||||||
pandas
|
|
||||||
super-image
|
super-image
|
||||||
basicsr
|
timm
|
||||||
facexlib
|
torch
|
||||||
|
torchvision
|
||||||
|
transformers
|
||||||
|
wheel
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
-c ../../constraints.txt
|
-c ../../constraints.txt
|
||||||
# This file contains requirements dependednt from modules in requirements.txt
|
# This file contains requirements dependednt from modules in requirements.txt
|
||||||
# get immutable commit to be able to use pip cache
|
natten -f https://shi-labs.com/natten/wheels/cpu/torch2.0.0/index.html
|
||||||
git+https://github.com/facebookresearch/detectron2.git@1a4df4d954089534daebbd7a0a45f08ece87056e
|
|
||||||
natten
|
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
import pytest
|
import pytest
|
||||||
import torch
|
import torch
|
||||||
from models_hub_common.utils import get_models_list, compare_two_tensors
|
from models_hub_common.utils import get_models_list, compare_two_tensors
|
||||||
@ -19,6 +20,9 @@ class TestDetectron2ConvertModel(TestTorchConvertModel):
|
|||||||
self.image = Image.open(requests.get(url, stream=True).raw)
|
self.image = Image.open(requests.get(url, stream=True).raw)
|
||||||
self.image = self.image.resize([640, 480])
|
self.image = self.image.resize([640, 480])
|
||||||
|
|
||||||
|
subprocess.run([sys.executable, "-m", "pip", "install",
|
||||||
|
"git+https://github.com/facebookresearch/detectron2.git@017abbfa5f2c2a2afa045200c2af9ccf2fc6227f"])
|
||||||
|
|
||||||
def load_model(self, model_name, model_link):
|
def load_model(self, model_name, model_link):
|
||||||
from detectron2 import model_zoo, export
|
from detectron2 import model_zoo, export
|
||||||
from detectron2.modeling import build_model, PanopticFPN
|
from detectron2.modeling import build_model, PanopticFPN
|
||||||
@ -82,6 +86,10 @@ class TestDetectron2ConvertModel(TestTorchConvertModel):
|
|||||||
is_ok = compare_two_tensors(cur_ov_res[:l], cur_fw_res[:l], fw_eps)
|
is_ok = compare_two_tensors(cur_ov_res[:l], cur_fw_res[:l], fw_eps)
|
||||||
assert is_ok, "Accuracy validation failed"
|
assert is_ok, "Accuracy validation failed"
|
||||||
|
|
||||||
|
def teardown_class(self):
|
||||||
|
subprocess.run(
|
||||||
|
[sys.executable, "-m", "pip", "uninstall", "-y", "detectron2"])
|
||||||
|
|
||||||
@pytest.mark.parametrize("name,type,mark,reason",
|
@pytest.mark.parametrize("name,type,mark,reason",
|
||||||
get_models_list(os.path.join(os.path.dirname(__file__), "detectron2_precommit")))
|
get_models_list(os.path.join(os.path.dirname(__file__), "detectron2_precommit")))
|
||||||
@pytest.mark.precommit
|
@pytest.mark.precommit
|
||||||
|
Loading…
Reference in New Issue
Block a user