From adcb74f87f09cb9db75b62a8690b53ae1552dda5 Mon Sep 17 00:00:00 2001 From: nateraw Date: Tue, 14 Sep 2021 01:11:40 -0400 Subject: [PATCH] :art: Import load_state_dict_from_url directly --- timm/models/helpers.py | 4 ++-- timm/models/hub.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/timm/models/helpers.py b/timm/models/helpers.py index 662a7a48..281f2412 100644 --- a/timm/models/helpers.py +++ b/timm/models/helpers.py @@ -11,10 +11,10 @@ from typing import Any, Callable, Optional, Tuple import torch import torch.nn as nn - +from torch.hub import load_state_dict_from_url from .features import FeatureListNet, FeatureDictNet, FeatureHookNet -from .hub import has_hf_hub, download_cached_file, load_state_dict_from_hf, load_state_dict_from_url +from .hub import has_hf_hub, download_cached_file, load_state_dict_from_hf from .layers import Conv2dSame, Linear diff --git a/timm/models/hub.py b/timm/models/hub.py index 31593f88..a436aff6 100644 --- a/timm/models/hub.py +++ b/timm/models/hub.py @@ -6,7 +6,7 @@ from pathlib import Path from typing import Union import torch -from torch.hub import HASH_REGEX, download_url_to_file, urlparse, load_state_dict_from_url +from torch.hub import HASH_REGEX, download_url_to_file, urlparse try: from torch.hub import get_dir except ImportError: