diff --git a/lightly/utils/dependency.py b/lightly/utils/dependency.py index 292e1eb64..dd36a6506 100644 --- a/lightly/utils/dependency.py +++ b/lightly/utils/dependency.py @@ -52,9 +52,8 @@ def torchvision_transforms_v2_available() -> bool: True if transforms.v2 are available, False otherwise """ try: - from torchvision.transforms import v2 as torchvision_transforms + from torchvision.transforms import v2 except ImportError: - from torchvision import transforms as torchvision_transforms return False return True