fpath = osp.abspath(osp.expanduser(fpath))

pull/462/head^2
kaiyangzhou 2021-08-11 16:50:56 +08:00
parent 1d143ad8a4
commit b8b91acbd5
1 changed files with 1 additions and 0 deletions

View File

@ -77,6 +77,7 @@ def load_checkpoint(fpath):
"""
if fpath is None:
raise ValueError('File path is None')
fpath = osp.abspath(osp.expanduser(fpath))
if not osp.exists(fpath):
raise FileNotFoundError('File is not found at "{}"'.format(fpath))
map_location = None if torch.cuda.is_available() else 'cpu'