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, 'H'. #543

Open
WXY-Belief opened this issue Aug 26, 2023 · 2 comments
Open

_pickle.UnpicklingError: invalid load key, 'H'. #543

WXY-Belief opened this issue Aug 26, 2023 · 2 comments

Comments

@WXY-Belief
Copy link

hello, when runing your code, there exist a error as follow:
Traceback (most recent call last):
File "D:\PycharmProjects\3D_align\voxelmorph-dev\register.py", line 77, in
model = vxm.networks.VxmDense.load(args.model, device)
File "D:\PycharmProjects\3D_align\voxelmorph-dev\voxelmorph\torch\modelio.py", line 74, in load
checkpoint = torch.load(path, map_location=torch.device(device))
File "C:\Users\24667.conda\envs\wxy_env\lib\site-packages\torch\serialization.py", line 795, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\24667.conda\envs\wxy_env\lib\site-packages\torch\serialization.py", line 1002, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'H'.

@lchauvin
Copy link

lchauvin commented Apr 9, 2024

I'm getting the same error. Any help ?

I tried with models: synthmorph.deform.2.h5, vxm_dense_brain_T1_3D_mse.h5, shapes-dice-vel-3-res-8-16-32-256f.h5 and brains-dice-vel-0.5-res-16-256f.h5

I precise that I'm using pytorch backend. Are models provided only for tensorflow ?

@A-shazli
Copy link

This is a Keras model .H to open in pytorch i think it should be .pt dont know if there is a way to convert .h to .pt

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

3 participants