Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_pickle.UnpicklingError: invalid load key, '<' #9

Open
atzshjh opened this issue Nov 14, 2023 · 4 comments
Open

_pickle.UnpicklingError: invalid load key, '<' #9

atzshjh opened this issue Nov 14, 2023 · 4 comments

Comments

@atzshjh
Copy link

atzshjh commented Nov 14, 2023

(test) jiehu@jiehu-Z490-AORUS-MASTER:/media/jiehu/hard_disk/work_data_hd/code/open_source/surface_normal_uncertainty$ python test.py --pretrained scannet --architecture BN
loading checkpoint... /media/jiehu/hard_disk/work_data_hd/code/open_source/surface_normal_uncertainty/checkpoints/scannet.pt
Using cache found in /home/jiehu/.cache/torch/hub/rwightman_gen-efficientnet-pytorch_master
Downloading: "https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/tf_efficientnet_b5_ap-9e82fae8.pth" to /home/jiehu/.cache/torch/hub/checkpoints/tf_efficientnet_b5_ap-9e82fae8.pth
Loading base model ()...ffff: <_io.BufferedReader name='/home/jiehu/.cache/torch/hub/checkpoints/tf_efficientnet_b5_ap-9e82fae8.pth'>
Done.
Removing last two layers (global_pool & classifier).
fpath: /media/jiehu/hard_disk/work_data_hd/code/open_source/surface_normal_uncertainty/checkpoints/scannet.pt
ffff: <_io.BufferedReader name='/media/jiehu/hard_disk/work_data_hd/code/open_source/surface_normal_uncertainty/checkpoints/scannet.pt'>
Traceback (most recent call last):
File "test.py", line 97, in
model = utils.load_checkpoint(checkpoint, model)
File "/media/jiehu/hard_disk/work_data_hd/code/open_source/surface_normal_uncertainty/utils/utils.py", line 49, in load_checkpoint
ckpt = torch.load(fpath, map_location='cpu')['model']
File "/home/jiehu/anaconda3/envs/test/lib/python3.8/site-packages/torch/serialization.py", line 713, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/jiehu/anaconda3/envs/test/lib/python3.8/site-packages/torch/serialization.py", line 920, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

maybe the checkpoint file is not correct, please help check it, thanks.

@Genshin-Impact-king
Copy link

have you solved this?

@Genshin-Impact-king
Copy link

it may be helpful for you #4

@baegwangbin
Copy link
Owner

Sorry for the delayed response.

Are you still experiencing this issue?

@johanna0626
Copy link

This is because the model downloaded by download.py is incomplete (you can check the *.pt file yourself). Downloading the complete file from the author's Google Drive and putting it in the corresponding data folders can solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants