Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

Retry torchvision tests on OSError (#26066)

Maxim Vafin23b633d3d2d6
diff --git a/tests/model_hub_tests/pytorch/test_torchvision_models.py b/tests/model_hub_tests/pytorch/test_torchvision_models.py
index 31aeaedb236..6204d57741e 100644
--- a/tests/model_hub_tests/pytorch/test_torchvision_models.py
+++ b/tests/model_hub_tests/pytorch/test_torchvision_models.py
@@ -7,7 +7,7 @@ import tempfile
import pytest
import torch
import torchvision.transforms.functional as F
-from models_hub_common.utils import get_models_list
+from models_hub_common.utils import get_models_list, retry
from torch_utils import TestTorchConvertModel
@@ -54,6 +54,7 @@ torch.manual_seed(0)
class TestTorchHubConvertModel(TestTorchConvertModel):
+ @retry(3, exceptions=(OSError,), delay=1)
def load_model(self, model_name, model_link):
m = torch.hub.load("pytorch/vision", model_name,
weights='DEFAULT', skip_validation=True)