Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ignite/metrics/gan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class InceptionModel(torch.nn.Module):

def __init__(self, return_features: bool, device: Union[str, torch.device] = "cpu") -> None:
try:
import torchvision
from torchvision import models
except ImportError:
raise RuntimeError("This module requires torchvision to be installed.")
super(InceptionModel, self).__init__()
self._device = device
if Version(torch.__version__) <= Version("1.7.0"):
if Version(torchvision.__version__) < Version("0.13.0"):
model_kwargs = {"pretrained": True}
else:
model_kwargs = {"weights": models.Inception_V3_Weights.DEFAULT}
Expand Down
2 changes: 1 addition & 1 deletion tests/ignite/handlers/test_state_param_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
)

if Version(torch.__version__) <= Version("1.7.0"):
if Version(torch.__version__) < Version("1.9.0"):
torch_testing_assert_close = torch.testing.assert_allclose
else:
torch_testing_assert_close = torch.testing.assert_close
Expand Down