Skip to content

Commit 8de4404

Browse files
authored
Remove unreachable torchvision<0.14 fallback in get_torchvision_model (#21849)
1 parent 92b5c39 commit 8de4404

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/lightning/pytorch/utilities/model_helpers.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import os
1818
from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, TypeVar
1919

20-
from lightning_utilities.core.imports import RequirementCache
2120
from torch import nn
2221
from typing_extensions import Concatenate, ParamSpec, override
2322

@@ -54,11 +53,7 @@ def get_torchvision_model(model_name: str, **kwargs: Any) -> nn.Module:
5453

5554
from torchvision import models
5655

57-
torchvision_greater_equal_0_14 = RequirementCache("torchvision>=0.14.0")
58-
# TODO: deprecate this function when 0.14 is the minimum supported torchvision
59-
if torchvision_greater_equal_0_14:
60-
return models.get_model(model_name, **kwargs)
61-
return getattr(models, model_name)(**kwargs)
56+
return models.get_model(model_name, **kwargs)
6257

6358

6459
class _ModuleMode:

0 commit comments

Comments
 (0)