Skip to content

Commit e64eb4b

Browse files
authored
To resolve issue #2674 update version check (#2676)
* To resolve issue #2674 Update version check * Update test_state_param_scheduler.py Update version check * Update utils.py
1 parent 98844bf commit e64eb4b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ignite/metrics/gan/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ class InceptionModel(torch.nn.Module):
1919

2020
def __init__(self, return_features: bool, device: Union[str, torch.device] = "cpu") -> None:
2121
try:
22+
import torchvision
2223
from torchvision import models
2324
except ImportError:
2425
raise RuntimeError("This module requires torchvision to be installed.")
2526
super(InceptionModel, self).__init__()
2627
self._device = device
27-
if Version(torch.__version__) <= Version("1.7.0"):
28+
if Version(torchvision.__version__) < Version("0.13.0"):
2829
model_kwargs = {"pretrained": True}
2930
else:
3031
model_kwargs = {"weights": models.Inception_V3_Weights.DEFAULT}

tests/ignite/handlers/test_state_param_scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
},
3939
)
4040

41-
if Version(torch.__version__) <= Version("1.7.0"):
41+
if Version(torch.__version__) < Version("1.9.0"):
4242
torch_testing_assert_close = torch.testing.assert_allclose
4343
else:
4444
torch_testing_assert_close = torch.testing.assert_close

0 commit comments

Comments
 (0)