YBIGTA/pytorch-hair-segmentation

_pickle.UnpicklingError: invalid load key, 'v'.

Closed this issue · 7 comments

Traceback (most recent call last):
File "evaluate.py", line 51, in
state = torch.load(ckpt_dir)
File "/jet/var/python/lib/python3.6/site-packages/torch/serialization.py", line 367, in load
return _load(f, map_location, pickle_module)
File "/jet/var/python/lib/python3.6/site-packages/torch/serialization.py", line 528, in _load
magic_number = pickle_module.load(f)
_pickle.UnpicklingError: invalid load key, 'v'.

when load pspnet_resnet101_sgd_lr_0.002_epoch_100_test_iou_0.918.pth have this error.
but the weights which i trainded can works.

Hello, I have encountered the same problem. Is your problem solved?

I don't use his weights. I train by myself use his parameters. sgd 0.002 pspnet_resnet101 100

#37 reference this issue. weight should be downloaded with git-lfs

But how to "Download the weights with git-lfs"?

when you git clone the repo, the file in model are not the correct one, there are too big to be download by git, there are replace by text file. You can either download them manually, on the website github just click on download, either using git-lfs who is "An open source Git extension for versioning large files" who manage this kind of file in this project.

In case it helps anyone else... After installing git lfs on my machine, and cloning and checking out a repo that was configured with LFS, and that contained the models I wanted to use, I still needed to do git lfs pull in order to get rid of this error

@antoniovs1029 I've tried your solution and it worked for me too!

However, I wonder why we have to do this. Can't we just pull from git as normal and those big files (stored in lfs) come along?