surface_normal_uncertainty icon indicating copy to clipboard operation
surface_normal_uncertainty copied to clipboard

_pickle.UnpicklingError: invalid load key, '<'

Open atzshjh opened this issue 2 years ago • 4 comments

(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.

atzshjh avatar Nov 14 '23 12:11 atzshjh

have you solved this?

ChengWan9 avatar Nov 23 '23 03:11 ChengWan9

it may be helpful for you #4

ChengWan9 avatar Nov 23 '23 03:11 ChengWan9

Sorry for the delayed response.

Are you still experiencing this issue?

baegwangbin avatar Dec 01 '23 16:12 baegwangbin

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.

johanna0626 avatar Jan 02 '24 23:01 johanna0626