Skip to content
Merged
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
8 changes: 4 additions & 4 deletions mmengine/runner/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ def load_from_local(filename, map_location):
filename = osp.expanduser(filename)
if not osp.isfile(filename):
raise FileNotFoundError(f'{filename} can not be found.')
checkpoint = torch.load(filename, map_location=map_location)
checkpoint = torch.load(filename, map_location=map_location, weights_only=False)
return checkpoint


Expand Down Expand Up @@ -412,7 +412,7 @@ def load_from_pavi(filename, map_location=None):
with TemporaryDirectory() as tmp_dir:
downloaded_file = osp.join(tmp_dir, model.name)
model.download(downloaded_file)
checkpoint = torch.load(downloaded_file, map_location=map_location)
checkpoint = torch.load(downloaded_file, map_location=map_location, weights_only=False)
return checkpoint


Expand All @@ -435,7 +435,7 @@ def load_from_ceph(filename, map_location=None, backend='petrel'):
file_backend = get_file_backend(
filename, backend_args={'backend': backend})
with io.BytesIO(file_backend.get(filename)) as buffer:
checkpoint = torch.load(buffer, map_location=map_location)
checkpoint = torch.load(buffer, map_location=map_location, weights_only=False)
return checkpoint


Expand Down Expand Up @@ -504,7 +504,7 @@ def load_from_openmmlab(filename, map_location=None):
filename = osp.join(_get_mmengine_home(), model_url)
if not osp.isfile(filename):
raise FileNotFoundError(f'{filename} can not be found.')
checkpoint = torch.load(filename, map_location=map_location)
checkpoint = torch.load(filename, map_location=map_location, weights_only=False)
return checkpoint


Expand Down
Loading