You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Objective of issue: Check for complex synapse fails in create_dense
Lava DL version:
0.3.0 (feature release)
0.2.1 (bug fixes)
[] 0.2.0 (current version)
0.1.2
Lava version:
0.4.0 (feature release)
0.3.1 (bug fixes)
[] 0.3.0 (current version)
0.2.0
0.1.2
I'm submitting a ...
bug report
feature request
documentation request
Current behavior:
In hdf5.py there is a line like this:
if isinstance(layer_config["weight"], NetDict):
Expected behavior:
It should go like this
if layer_config["complex_synapse"]
or like this
if "weight/imag" in layer_config.f:
Steps to reproduce:
import torch
from lava.lib.dl import slayer, netx
import h5py
rf_neuron_params = {
'threshold': 1.0,
"period": 10,
"decay": .07,
}
class TestModel(torch.nn.Module):
def __init__(self):
super(TestModel, self).__init__()
self.blocks = [slayer.block.rf.Dense(rf_neuron_params, 1, 1)]
def forward(self, x):
return self.blocks[0](x)
def export_hdf5(self, filename):
# network export to hdf5 format
h = h5py.File(filename, 'w')
layer = h.create_group('layer')
for i, b in enumerate(self.blocks):
b.export_hdf5(layer.create_group(f'{i}'))
model = TestModel()
model.forward(torch.zeros(1, 1, 1))
model.export_hdf5('network.net')
net = netx.hdf5.Network(net_config="network.net")
Related code:
Other information:
Error that is produced.
Traceback (most recent call last):
File "/home/mjurado3/lava-dl/error_reproduce.py", line 28, in <module>
net = netx.hdf5.Network(net_config="network.net")
File "/home/mjurado3/lava-dl/.venv/src/lava/src/lava/magma/core/process/process.py", line 33, in __call__
obj = type.__call__(cls, *args, **kwargs)
File "/home/mjurado3/lava-dl/.venv/lib/python3.9/site-packages/lava/lib/dl/netx/hdf5.py", line 79, in __init__
self.layers = self._create()
File "/home/mjurado3/lava-dl/.venv/lib/python3.9/site-packages/lava/lib/dl/netx/hdf5.py", line 544, in _create
layer, table = self.create_dense(
File "/home/mjurado3/lava-dl/.venv/lib/python3.9/site-packages/lava/lib/dl/netx/hdf5.py", line 318, in create_dense
if isinstance(layer_config["weight"], NetDict):
File "/home/mjurado3/lava-dl/.venv/lib/python3.9/site-packages/lava/lib/dl/netx/utils.py", line 68, in __getitem__
return self.f[key][()].astype(int).copy()
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "/home/mjurado3/lava-dl/.venv/lib/python3.9/site-packages/h5py/_hl/group.py", line 330, in __getitem__
raise TypeError("Accessing a group is done with bytes or str, "
TypeError: Accessing a group is done with bytes or str, not <class 'tuple'>
The text was updated successfully, but these errors were encountered:
Objective of issue: Check for complex synapse fails in create_dense
Lava DL version:
Lava version:
I'm submitting a ...
Current behavior:
In hdf5.py there is a line like this:
Expected behavior:
It should go like this
or like this
Steps to reproduce:
Related code:
Other information:
Error that is produced.
The text was updated successfully, but these errors were encountered: