-
Notifications
You must be signed in to change notification settings - Fork 446
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
Issues in loading Pre-trained model #73
Comments
|
I guess it caused by invalid file path, did ur dictionary contains "<"? |
No, it doesn't contain this '<'. |
Here is a similar issue I suppose your model is not completely downloaded? |
@Subhan-Zaheer Were you able to solve this issue ? I am encountering same issue |
Whenever I try to load pre-trained models, I get the following error:
`---------------------------------------------------------------------------
UnpicklingError Traceback (most recent call last)
in <cell line: 7>()
5
6 vtoonify = VToonify(backbone = 'dualstylegan')
----> 7 vtoonify.load_state_dict(torch.load(os.path.join(MODEL_DIR, style_type+'_generator.pt'), map_location=lambda storage, loc: storage)['g_ema'])
8 vtoonify.to(device)
9
1 frames
/usr/local/lib/python3.10/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, weights_only, mmap, **pickle_load_args)
1038 except RuntimeError as e:
1039 raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None
-> 1040 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
1041
1042
/usr/local/lib/python3.10/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
1256 "functionality.")
1257
-> 1258 magic_number = pickle_module.load(f, **pickle_load_args)
1259 if magic_number != MAGIC_NUMBER:
1260 raise RuntimeError("Invalid magic number; corrupt file?")
UnpicklingError: invalid load key, '<'.`
Can you please tell what's the issue here, is there a version incompatibility of language or framework.
The text was updated successfully, but these errors were encountered: