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

Compiled netx hdf5 models cannot be serialized. #253

Open
Gavinator98 opened this issue Oct 16, 2023 · 1 comment
Open

Compiled netx hdf5 models cannot be serialized. #253

Gavinator98 opened this issue Oct 16, 2023 · 1 comment
Assignees
Labels
1-bug Something isn't working

Comments

@Gavinator98
Copy link

Gavinator98 commented Oct 16, 2023

Describe the bug
netx hdf5 models create an error when attempting to save a compiled executable

To reproduce current behavior
Steps to reproduce the behavior:

  1. Load and compile a netx hdf5 model
from lava.lib.dl import netx
from lava.magma.core.run_configs import Loihi2HwCfg
from lava.utils.serialization import save

net = netx.hdf5.Network(net_config='some_model.net')
executable = net.compile(run_cfg=Loihi2HwCfg())

save(processes=[net],
     executable=executable,
     filename="compiled_model.pkl")
  1. Produces this error
h5py objects cannot be pickled

As a workaround, the h5py object can be removed before saving.

net.net_config = None 

Expected behavior
netx.hdf5.Network objects work with the save() function without modification.

Environment (please complete the following information):

  • Device: Server
  • OS: Linux
  • Lava version 0.8.0
  • Lava-Loihi version 0.5.0
@Gavinator98 Gavinator98 added the 1-bug Something isn't working label Oct 16, 2023
@PhilippPlank PhilippPlank self-assigned this Apr 19, 2024
@PhilippPlank
Copy link
Contributor

Thank you for reporting this issue. We are aware that this is not possible and it is an h5py issue in general. We are testing some mitigation strategies, but h5py is explicitly preventing to use pickle and changing the h5py package is not a general solution. If you need that, you can do it though (remove the exception in the h5py code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants