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

Unable to load isnet-general-use.pth #146

Open
naslevente opened this issue Jan 24, 2025 · 0 comments
Open

Unable to load isnet-general-use.pth #146

naslevente opened this issue Jan 24, 2025 · 0 comments

Comments

@naslevente
Copy link

Using the python code from the demo, I attempted to load the isnet-general-use.pth file. The link in the demo code (https://drive.google.com/uc?id=1KyMpRjewZdyYfxHPYcd-ZbanIXtin0Sn) resulted in a 404, so I looked around the repo and found the following link: https://drive.google.com/file/d/1XHIzgTzY5BQHw140EDIgwIb53K659ENH/view. I was able to successfully download this file and place it in the saved_models directory under the isnet.pth file name just like in the demo.

When I run the entire script, however, I get the following error:

/home/dis/anaconda3/envs/dis_env/lib/python3.7/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
  warnings.warn(warning.format(ret))
Traceback (most recent call last):
  File "impl.py", line 119, in <module>
    net = build_model(hypar, device)
  File "impl.py", line 66, in build_model
    net.load_state_dict(torch.load(hypar["model_path"]+"/"+hypar["restore_model"],map_location=device))
  File "/home/dis/anaconda3/envs/dis_env/lib/python3.7/site-packages/torch/serialization.py", line 593, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/dis/anaconda3/envs/dis_env/lib/python3.7/site-packages/torch/serialization.py", line 762, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '<'.

I'm using the CPU for device, and I setup a conda environment with Python 3.7 and PyTorch 1.8.

I was thinking maybe the PyTorch version I am using is not compatible with the pth file I am downloading, but I can't seem to get any more information about the issue.

Any help is much appreciated, and let me know if I need to provide more information!

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

1 participant