bmtk icon indicating copy to clipboard operation
bmtk copied to clipboard

bio_advanced_stimuli - "ValueError: argument not a density mechanism name."

Open mjhyman opened this issue 2 years ago • 1 comments

I am trying to run the example "bmtk/examples/bio_advanced_stimuli/run_bionet.py"

I first ran the script "bmtk/examples/bio_advanced_stimuli/build_network.py", which modified the files in the network subfolder. Then I modified the script "run_bionet.py" by removing the comment for run('config.simulation_xstim.json').

if __name__ == '__main__':
    if __file__ != sys.argv[-1]:
        run(sys.argv[-1])
    else:
        # Make sure to run only one at a time
        # run('config.simulation_iclamp.json')  # Current clamp stimulation
        run('config.simulation_xstim.json')  # Extracellular electrode stimulation
        # run('config.simulation_spikes.json')  # Synaptic stimulation with external virtual cells
        # run('config.simulation_spont_activity.json')  # Spontaneous synaptic activity

I ran the "run_bionet.py" script, and it raised a "ValueError" (see below). I tried running the different configuration files, and each time I received the same error.

The ValueError is occuring in the cell_models.py file. I inserted a breakpoint at this line and examined the value of p["mechanism"] on each iteration. For each iteration, this field contains the string 'lm', even when it raises the ValueError. I am unsure how to debug this issue further.

2022-03-15 10:07:40,285 [INFO] Created log file NEURON mechanisms not found in ./../bio_components/mechanisms. 2022-03-15 10:07:40,399 [INFO] Building cells. Traceback (most recent call last): File "C:\Users\macke\Documents\BU\classes\BE707_Quant_Studies_of_Excitable_Cells\be707_project\bmtk\examples\bio_advanced_stimuli\run_bionet.py", line 21, in run(sys.argv[-1]) File "C:\Users\macke\Documents\BU\classes\BE707_Quant_Studies_of_Excitable_Cells\be707_project\bmtk\examples\bio_advanced_stimuli\run_bionet.py", line 13, in run sim = bionet.BioSimulator.from_config(conf, network=graph) File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\biosimulator.py", line 402, in from_config network.build_nodes() File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\bionetwork.py", line 163, in build_nodes cell = self._build_cell(bionode=node, population_name=node_pop.name) File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\bionetwork.py", line 146, in _build_cell cell = self._model_type_map[bionode.model_type](bionode, population_name=population_name, bionetwork=self) File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\biocell.py", line 74, in init super(BioCell, self).init(node=node, population_name=population_name, network=bionetwork) File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\cell.py", line 54, in init self._hobj = node.load_cell() File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\sonata_adaptors.py", line 74, in load_cell hobj = processing_fnc(hobj, self, dynamics_params) File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\default_setters\cell_models.py", line 98, in aibs_perisomatic set_params_peri(hobj, dynamics_params) File "C:\Users\macke\AppData\Local\Programs\Python\Python39\lib\site-packages\bmtk-1.0.3-py3.9.egg\bmtk\simulator\bionet\default_setters\cell_models.py", line 152, in set_params_peri sec.insert(p["mechanism"]) ValueError: argument not a density mechanism name.

mjhyman avatar Mar 15 '22 14:03 mjhyman

same issue

ariu-m avatar Apr 25 '22 19:04 ariu-m

Unfortunately I have the same issue. Has anyone of you solved it by any chance? Thanks in advance for any help.

nicolomeneghetti avatar Sep 27 '22 14:09 nicolomeneghetti

This error often indicates that the NEURON mechanism files were not compiled. It looks like the mechanism components are located in bmtk/examples/bio_components/mechanisms. Try:

cd ../bio_components/mechanisms nrnivmodl modfiles

There should now be another folder alongside /modfiles with the compiled mechanisms.

Then go back and run run_bionet.py again. Does that work?

xpliu16 avatar Sep 27 '22 16:09 xpliu16

Dear xpliu16,

first of all thank you for your kind reply.

I've tried following your suggestion. Here's the error printed after having tried running "nrnivmodl modfiles".

/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_components/mechanisms Mod files: "modfiles/CaDynamics.mod" "modfiles/Ca_HVA.mod" "modfiles/Ca_LVA.mod" "modfiles/exp1isyn.mod" "modfiles/exp1syn.mod" "modfiles/Ih.mod" "modfiles/Im.mod" "modfiles/Im_v2.mod" "modfiles/Kd.mod" "modfiles/K_P.mod" "modfiles/K_T.mod" "modfiles/Kv2like.mod" "modfiles/Kv3_1.mod" "modfiles/Nap.mod" "modfiles/NaTa.mod" "modfiles/NaTs.mod" "modfiles/NaV.mod" "modfiles/SK.mod" "modfiles/stp1syn.mod" "modfiles/stp2syn.mod" "modfiles/stp3syn.mod" "modfiles/stp4syn.mod" "modfiles/stp5isyn.mod" "modfiles/stp5syn.mod" "modfiles/vecevent.mod"

Creating x86_64 directory for .o files.

COBJS='' -> Compiling mod_func.c /home/conda/feedstock_root/build_artifacts/neuron_1652441648626/_build_env/bin/x86_64-conda-linux-gnu-cc -g -O2 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/nest/anaconda3/envs/allen_inst_bkmt/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/neuron_1652441648626/work=/usr/local/src/conda/neuron-8.0.2 -fdebug-prefix-map=/home/nest/anaconda3/envs/allen_inst_bkmt=/usr/local/src/conda-prefix -I. -I/home/nest/anaconda3/envs/allen_inst_bkmt/include -fPIC -c mod_func.c -o mod_func.o make: /home/conda/feedstock_root/build_artifacts/neuron_1652441648626/_build_env/bin/x86_64-conda-linux-gnu-cc: No such file or directory make: *** [/home/nest/anaconda3/envs/allen_inst_bkmt/bin/nrnmech_makefile:120: mod_func.o] Error 127 make: *** Waiting for unfinished jobs.... -> NMODL ../modfiles/CaDynamics.mod (cd "../modfiles"; MODLUNIT=/home/nest/anaconda3/envs/allen_inst_bkmt/share/nrn/lib/nrnunits.lib /home/nest/anaconda3/envs/allen_inst_bkmt/bin/nocmodl CaDynamics.mod -o "/home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_components/mechanisms/x86_64") Translating CaDynamics.mod into /home/nest/Desktop/bmtk github stuff/bmtk-develop/examples/bio_components/mechanisms/x86_64/CaDynamics.c Thread Safe

For complete info, I also add that I am trying using bionet simulations in a conda environment on Lubuntu 22.04 (in which poinet simulations work perfectly fine - I've run pointnet simulations in Spyder).

Thanks again in advance for any help

Best,

Nicolò

nicolomeneghetti avatar Sep 27 '22 16:09 nicolomeneghetti

Sorry, I'm not sure, but maybe try installing / reinstalling GCC or some C compiler?

Or, https://stackoverflow.com/questions/46450912/unable-to-execute-x86-64-conda-cos6-linux-gnu-gcc-no-such-file-or-directory which says: "It looks like Anaconda had a new release (4.3.27) that sets the C compiler path to a non-existing executable (quite an embarrassing bug; I'm sure they'll fix it soon). I had a similar issue with pip installing using the latest Miniconda, which I fixed by using the 4.3.21 version."

brainmodelingtools avatar Sep 27 '22 17:09 brainmodelingtools

Dear all,

Thanks for your suggestions.

I've solved with this:

https://github.com/ContinuumIO/anaconda-issues/issues/11603#issuecomment-586124255

Thanks again,

Best,

Nicolò

nicolomeneghetti avatar Sep 28 '22 14:09 nicolomeneghetti

Glad this was resolved!

xpliu16 avatar Sep 28 '22 17:09 xpliu16