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

Multiscale_Brain_Structure_Simulation Errors under Windows #144

Open
lonnietc opened this issue Aug 8, 2023 · 5 comments
Open

Multiscale_Brain_Structure_Simulation Errors under Windows #144

lonnietc opened this issue Aug 8, 2023 · 5 comments

Comments

@lonnietc
Copy link

lonnietc commented Aug 8, 2023

Hello,

I have tried to run the brain models with Python 3.9, 3.10, and 3.11 under "Multiscale_Brain_Structure_Simulation" models like "HumanBrain", "MouseBrain", and "" and am getting errors like this.

---- Human Brain ----

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\HumanBrain> python .\human_brain.py
torch.Size([3442000, 2])
Traceback (most recent call last):
  File "D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\HumanBrain\human_brain.py", line 185, in <module>
    model = brain(syn, weight, neuron_model, p_neuron, dt, device)
  File "D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\HumanBrain\human_brain.py", line 46, in __init__
    self.neurons = HHNode(p_neuron, dt, device)
TypeError: __init__() missing 1 required positional argument: 'type_index'

---- Mouse Brain ----

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\MouseBrain> python .\mouse_brain.py
torch.Size([52238965, 2])
Traceback (most recent call last):
  File "D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\MouseBrain\mouse_brain.py", line 186, in <module>
    model = brain(syn, weight, neuron_model, p_neuron, dt, device)
  File "D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\MouseBrain\mouse_brain.py", line 47, in __init__
    self.neurons = aEIF(p_neuron, dt, device)
TypeError: __init__() missing 1 required positional argument: 'type_index'

---- MacaqueBrain ----

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\MacaqueBrain> python .\macaque_brain.py
torch.Size([38960200, 2])
Traceback (most recent call last):
  File "D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\MacaqueBrain\macaque_brain.py", line 185, in <module>
    model = brain(syn, weight, neuron_model, p_neuron, dt, device)
  File "D:\BrainCog\examples\Multiscale_Brain_Structure_Simulation\MacaqueBrain\macaque_brain.py", line 47, in __init__
    self.neurons = aEIF(p_neuron, dt, device)
TypeError: __init__() missing 1 required positional argument: 'type_index'

Any thoughts?
Thanks

@craree
Copy link
Contributor

craree commented Aug 9, 2023

The version you installed by 'pip install braincog' is inconsistent with the online version on GitHub. You can clone braincog from github(see https://www.brain-cog.network/docs/tutorial/1_installation.html):
git clone https://github.com/braincog-X/Brain-Cog.git
cd Brain-Cog
pip install -e .
Or you can copy the code of HHNode and aEIF in braincog/base/node/node.py on github

@lonnietc
Copy link
Author

lonnietc commented Aug 9, 2023

Thanks for getting back to me on this.

What version of Python do you typically use?

Also, I actually followed the install tutorial

https://www.youtube.com/watch?v=XkHq-MbKo20&list=PLNXUFsTshMlYTW6oleY5YjVEfnoQSw0N7&index=2

with references to the Brain Cod Github repo information as well.

@lonnietc
Copy link
Author

lonnietc commented Aug 9, 2023

I did a clean re-install of Brain Cog and things seem to run now with just on "UserWarning"


D:\BrainCog\Brain-Cog\examples\Multiscale_Brain_Structure_Simulation\HumanBrain\human_brain.py:201: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
  Iraster = torch.tensor(Iraster).transpose(0, 1)

Also, is there somewhere I can get the paper since I do not have access to this particular one from where I am at:

    @article{Liu2016,
    author={Liu, Xin and Zeng, Yi and Zhang, Tielin and Xu, Bo},
    title={Parallel Brain Simulator: A Multi-scale and Parallel Brain-Inspired Neural Network Modeling and Simulation Platform},
    journal={Cognitive Computation},
    year={2016},
    month={Oct},
    day={01},
    volume={8},
    number={5},
    pages={967--981},
    issn={1866-9964},
    doi={10.1007/s12559-016-9411-y},
    url={https://doi.org/10.1007/s12559-016-9411-y}

@craree
Copy link
Contributor

craree commented Aug 10, 2023

I think a python version over 3.7 is sufficient.

The methods in this article are not what our current code uses. I share the paper in the following link:
https://drive.google.com/file/d/1p-ewKNzUFaAgf3jKa0FcE-yWPHI7iWoT/view?usp=sharing

@lonnietc
Copy link
Author

Thanks for the quick response and for the paper link that I will read with great interest.

I will give the Python 3.7 a try to see how it runs the examples to see how that goes.

Eventually, I would like to see about adding some new models to the Brain Cog Model_Zoo since I think that it could be helpful for the eventual modeling of a virtual full brain simulation towards AGI.

One step forward would be to work out a good spiking RNN approach for a Question & Answering system maybe building on something in the "Knowledge Representation and Reasoning" section.

Thanks again

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

2 participants