-
Notifications
You must be signed in to change notification settings - Fork 86
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
ERROR:NestIOUtils:weights must be a 1-dimensional NumPy array #259
Comments
I would also like to add the two network csv files:
|
When building the network, what were the connection_rule and connection_params? In the edges HDF5 file, are nsyns defined for all connections? |
Thanks first of all for your reply. I have copied both the connection_rule and connection_params in some example code. Here follows the code that I have used for adding the edges in the biophysical detailed model (that is called l4): def exc_exc_rule(source, target, max_syns): conns = l4.add_edges( from bmtk.builder.bionet import rand_syn_locations conns.add_properties( def others_conn_rule(source, target, max_syns, max_distance=300.0, sigma=60.0): %%%%%%%%%%%%%%% conns.add_properties( %%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%% As far as it concerns the edges HDF5 file I can't see the nsyns in the keys. Thanks again in advance for any help. Best |
Thanks for bringing this issue to our attention - we think it is an interaction between conversion, add_properties, and perhaps also Nest version. BMTK will store synapse weights as a single number if it is given as such (to be apply to all synapses). Nest, at least the Nest 3 versions, seem to only allow an array to be received. I believe normally, this isn't an issue because nsyns is different for the different edges and forces the total weight = weight * nsyns to be an array. Add_properties gives each individual synapse an entry and we lose nsyns. We've merged a little fix. Try pulling from the repo and rerunning python setup.py install. Let us know if that fixes it for you? |
Thanks for the reply. One last question (before opening another issue but of different nature D: ): can I update this fix by running again the conda installation? Thanks in adavce, Best |
Kael just put up a new release and updated anaconda. Can you try that and see if it fixes the issue for you? |
Dear alls, thank you very much. This problem has been solved. Concurrently, however, I am now facing a new issue when trying using bionet. For example I tried running the "bio_14cells" example and I got this neuron error: Python 3.9.7 | packaged by conda-forge | (default, Sep 29 2021, 19:23:11) IPython 7.31.1 -- An enhanced Interactive Python. runfile('/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_14cells/run_bionet.py', wdir='/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_14cells') [....] error ./../bio_components/morphologies/Scnn1a_473845048_m.swc line 3781: could not parse: 3778 3 196.7028 334.8694 12.9396 0.2089 3777 File "/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_14cells/run_bionet.py", line 32, in File "/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_14cells/run_bionet.py", line 12, in run File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/biosimulator.py", line 402, in from_config File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/bionetwork.py", line 178, in build_nodes File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/bionetwork.py", line 161, in _build_cell File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/biocell.py", line 75, in init File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/cell.py", line 54, in init File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/sonata_adaptors.py", line 70, in load_cell File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/bionet/default_setters/cell_models.py", line 75, in Biophys1 RuntimeError: hoc error I have also tried running again nrnivmodl with no sucess unfortunately. By the way, if this is a new unrelated issue I will open another issue post here so that you can close the current one as solved. Thanks again for your help, Best regards, Nicolò |
Dear all, I have solved the error mentioned in the previous comment. I leave here the solution in case anyone else would need. The "RuntimeError: hoc error" mentioned above seems to be due to a change I made in Spyder's preferences. The error indeed occured when I set the 'Graphics backend' to 'Automatic' instead of the (default) 'Inline' option. By setting again the Inline option and restarting a new spyder console solved the problem for me. Honestly I am not sure why this fix works , yet it does.... Thanks again for your help, Best regards, Nicolò |
Glad you were able to resolve that and really appreciate you sharing the solution! |
Yes, the problems were solved with the new release. Thank again for your help, Best regards, Nicolò |
Hi all.
I was trying to convert a (very simple) custom-made bionet into a point neuron model.
I tried doing this by copying the network of the biophysical model into a new folder and modifying:
After having built the environment through the command:
from bmtk.utils.sim_setup import build_env_pointnet
build_env_pointnet(base_dir='.',
network_dir='network',
config_file='config.point.json',
tstop=3000.0,
dt=0.01,
current_clamp= {
'amp': 0.150, # Current size (pA)
'delay': 500, # Time from start of simulation to onset of step (ms)
'duration': 2000 # Duration of current step (ms)
},
include_examples=True, # Copies components files
)
I get this error message:
Copyright (C) 2004 The NEST Initiative
Version: 3.3
Built: Aug 9 2022 10:44:45
This program is provided AS IS and comes with
NO WARRANTY. See the file LICENSE for details.
Problems or suggestions?
Visit https://www.nest-simulator.org
Type 'nest.help()' to find out more about NEST.
2022-10-18 22:08:40,086 [INFO] Created log file
INFO:NestIOUtils:Created log file
2022-10-18 22:08:40,106 [INFO] Batch processing nodes for l4/0.
INFO:NestIOUtils:Batch processing nodes for l4/0.
2022-10-18 22:08:40,110 [INFO] Batch processing nodes for l4/1.
INFO:NestIOUtils:Batch processing nodes for l4/1.
2022-10-18 22:08:40,120 [INFO] Setting up output directory
INFO:NestIOUtils:Setting up output directory
2022-10-18 22:08:40,122 [INFO] Building cells.
INFO:NestIOUtils:Building cells.
2022-10-18 22:08:40,128 [INFO] Building recurrent connections
INFO:NestIOUtils:Building recurrent connections
2022-10-18 22:08:40,136 [ERROR] weights must be a 1-dimensional NumPy array
ERROR:NestIOUtils:weights must be a 1-dimensional NumPy array
Traceback (most recent call last):
File "/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/nico_try_pointconv/run_pointnet.py", line 14, in
main('/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/nico_try_pointconv/config.l4point.json')
File "/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/nico_try_pointconv/run_pointnet.py", line 9, in main
sim = pointnet.PointSimulator.from_config(configure, network)
File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/pointnet/pointsimulator.py", line 243, in from_config
graph.build_recurrent_edges()
File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/pointnet/pointnetwork.py", line 171, in build_recurrent_edges
self._nest_connect(nest_srcs, nest_trgs, conn_spec='one_to_one', syn_spec=edge.nest_params)
File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/bmtk/simulator/pointnet/pointnetwork.py", line 227, in _nest_connect
nest.Connect(nest_srcs, nest_trgs, conn_spec=conn_spec, syn_spec=syn_spec)
File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/nest/ll_api.py", line 229, in stack_checker_func
return f(*args, **kwargs)
File "/home/nest/anaconda3/envs/allen_inst_bkmt/lib/python3.9/site-packages/nest/lib/hl_api_connections.py", line 257, in Connect
connect_arrays(pre, post, weights, delays, synapse_model, syn_param_keys, syn_param_values)
File "pynestkernel.pyx", line 300, in pynestkernel.NESTEngine.connect_arrays
TypeError: weights must be a 1-dimensional NumPy array
Can someone help me out?
Thank you in advance for any help.
The text was updated successfully, but these errors were encountered: