Skip to content
Open
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
2 changes: 1 addition & 1 deletion monai/apps/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
1 change: 0 additions & 1 deletion monai/bundle/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", "") == "":
Expand Down
4 changes: 2 additions & 2 deletions monai/networks/nets/hovernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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:
Expand Down
Loading