diff --git a/monai/apps/utils.py b/monai/apps/utils.py index 856bc64c9e..0ce49c82a4 100644 --- a/monai/apps/utils.py +++ b/monai/apps/utils.py @@ -240,7 +240,7 @@ def download_url( if urlparse(url).netloc == "drive.google.com": if not has_gdown: raise RuntimeError("To download files from Google Drive, please install the gdown dependency.") - if "fuzzy" not in gdown_kwargs: + if "fuzzy" not in gdown_kwargs and not min_version(gdown, "6.0.0"): # "fuzzy" dropped in gdown 6.0.0 gdown_kwargs["fuzzy"] = True # default to true for flexible url gdown.download(url, f"{tmp_name}", quiet=not progress, **gdown_kwargs) elif urlparse(url).netloc == "cloud-api.yandex.net": diff --git a/monai/bundle/scripts.py b/monai/bundle/scripts.py index ab02cd552e..63a774bfea 100644 --- a/monai/bundle/scripts.py +++ b/monai/bundle/scripts.py @@ -2005,7 +2005,6 @@ def download_large_files(bundle_path: str | None = None, large_file_name: str | parser.read_config(large_file_path) large_files_list = parser.get()["large_files"] for lf_data in large_files_list: - lf_data["fuzzy"] = True if "hash_val" in lf_data and lf_data.get("hash_val", "") == "": lf_data.pop("hash_val") if "hash_type" in lf_data and lf_data.get("hash_type", "") == "": diff --git a/monai/networks/nets/hovernet.py b/monai/networks/nets/hovernet.py index f0cb5ab74d..1d652782fa 100644 --- a/monai/networks/nets/hovernet.py +++ b/monai/networks/nets/hovernet.py @@ -632,7 +632,7 @@ def _remap_preact_resnet_model(model_url: str): pattern_bna = re.compile(r"^(.+\.d\d+)\.blk_bna\.(.+)") # download the pretrained weights into torch hub's default dir weights_dir = os.path.join(torch.hub.get_dir(), "preact-resnet50.pth") - download_url(model_url, fuzzy=True, filepath=weights_dir, progress=False) + download_url(model_url, filepath=weights_dir, progress=False) map_location = None if torch.cuda.is_available() else torch.device("cpu") state_dict = torch.load(weights_dir, map_location=map_location, weights_only=True)["desc"] @@ -667,7 +667,7 @@ def _remap_standard_resnet_model(model_url: str, state_dict_key: str | None = No pattern_downsample1 = re.compile(r"^(res_blocks.d\d+).+\.downsample\.1\.(.+)") # download the pretrained weights into torch hub's default dir weights_dir = os.path.join(torch.hub.get_dir(), "resnet50.pth") - download_url(model_url, fuzzy=True, filepath=weights_dir, progress=False) + download_url(model_url, filepath=weights_dir, progress=False) map_location = None if torch.cuda.is_available() else torch.device("cpu") state_dict = torch.load(weights_dir, map_location=map_location, weights_only=True) if state_dict_key is not None: