Giter VIP home page Giter VIP logo

retina's Introduction

Neurokernel

Package Description

Project Website | GitHub Repository | Online Documentation | Mailing List | Forum

Neurokernel is a Python framework for developing models of the fruit fly brain and executing them on multiple NVIDIA GPUs.

Support the project

Prerequisites

Neurokernel requires

  • Linux (other operating systems may work, but have not been tested);
  • Python;
  • at least one NVIDIA GPU with Fermi architecture or later;
  • NVIDIA's GPU drivers;
  • CUDA 5.0 or later;
  • OpenMPI 1.8.4 or later compiled with CUDA support.

To check what GPUs are in your system, you can use the inxi command available on most Linux distributions:

inxi -G

You can verify that the drivers are loaded as follows:

lsmod | grep nvidia

If no drivers are present, you may have to manually load them by running something like:

modprobe nvidia

as root.

Although some Linux distributions do include CUDA in their stock package repositories, you are encouraged to use those distributed by NVIDIA because they often are more up-to-date and include more recent releases of the GPU drivers. See this page for download information.

If you install Neurokernel in a virtualenv environment, you will need to install OpenMPI. See this page for OpenMPI installation information. Note that OpenMPI 1.8 cannot run on Windows_.

Some of Neurokernel's demos require either ffmpeg or libav installed to generate visualizations (see Examples).

Installation

Conda

The easiest way to get neurokernel is to install it in a conda environment: :

conda create -n nk python=3.7 c-compiler compilers cxx-compiler openmpi -c conda-forge -y
conda activate nk
python -m pip install neurokernel

Make sure to enable CUDA support in the installed OpenMPI by setting: :

export OMPI_MCA_opal_cuda_support=true

Examples

Introductory examples of how to use Neurokernel to build and integrate models of different parts of the fly brain are available in the Neurodriver package. To install it run the following: :

git clone https://github.com/neurokernel/neurodriver
cd ~/neurodriver
python setup.py develop

Other models built using Neurokernel are available on GitHub.

Building the Documentation

To build Neurokernel's HTML documentation locally, you will need to install

Once these are installed, run the following: :

cd ~/neurokernel/docs
make html

Authors & Acknowledgements

See the included AUTHORS file for more information.

License

This software is licensed under the BSD License. See the included LICENSE file for more information.

retina's People

Contributors

kpsychas avatar lebedov avatar mkturkcan avatar yiyin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

retina's Issues

retina_worker_only_demo problem caused by networkx

Hi,
the following bug occurs when I run retina_worker_only_demo.py

2021-10-07T01:49:38Z:INFO:man |manager instantiated
2021-10-07T01:49:43Z:ERROR:man |File "/Aurel-retina-master/examples/retina_worker_only_demo/retina_worker_only_demo.py", line 458, in
2021-10-07T01:49:43Z:ERROR:man | main()
2021-10-07T01:49:43Z:ERROR:man |File "/Aurel-retina-master/examples/retina_worker_only_demo/retina_worker_only_demo.py", line 452, in main
2021-10-07T01:49:43Z:ERROR:man | add_retina_LPU(config, 0, retina, manager)
2021-10-07T01:49:43Z:ERROR:man |File "/Aurel-retina-master/examples/retina_worker_only_demo/retina_worker_only_demo.py", line 353, in add_retina_LPU
2021-10-07T01:49:43Z:ERROR:man | (comp_dict, conns) = LPU.graph_to_dicts(G)
2021-10-07T01:49:43Z:ERROR:man |File "/neurodriver-master/neurokernel/LPU/LPU.py", line 207, in graph_to_dicts
2021-10-07T01:49:43Z:ERROR:man | comps = graph.nodes.items()
2021-10-07T01:49:43Z:ERROR:man |AttributeError: 'function' object has no attribute 'items'

I thought this was caused by the too low version networkx, so I update the package to version 2.0
Instead, I got the log telling me that:

2021-10-07T01:58:47Z:INFO:man |manager instantiated
2021-10-07T01:58:48Z:ERROR:man |File "/Aurel-retina-master/examples/retina_worker_only_demo/retina_worker_only_demo.py", line 458, in
2021-10-07T01:58:48Z:ERROR:man | main()
2021-10-07T01:58:48Z:ERROR:man |File "/Aurel-retina-master/examples/retina_worker_only_demo/retina_worker_only_demo.py", line 445, in main
2021-10-07T01:58:48Z:ERROR:man | retina = ret.RetinaArray(hexagon, config)
2021-10-07T01:58:48Z:ERROR:man |File "/Aurel-retina-master/retina/retina.py", line 86, in init
2021-10-07T01:58:48Z:ERROR:man | self._generate_graph()
2021-10-07T01:58:48Z:ERROR:man |File "/Aurel-retina-master/retina/retina.py", line 216, in _generate_graph
2021-10-07T01:58:48Z:ERROR:man | G_workers_nomaster.add_node(neuron.id, neuron.params.copy())
2021-10-07T01:58:48Z:ERROR:man |TypeError: add_node() takes exactly 2 arguments (3 given)

This problem can be solved by changing the networkx version to 1.11 but 1.11 will again cause the upper problem.

Where does the problem come from exactly?

Thanks a lot!

Problem met when try to run retina_demo.py

Hello!
When I tried to run python retina_demo.py -c retina_default.cfg -v -1, It comes the problem:

Traceback (most recent call last):
File "retina_demo.py", line 17, in
from retina.input_generator import RetinaInputGenerator
ImportError: No module named input_generator

I have already installed the neurokernel and neurokernel/retina.
I have no problem importing retina, but I have no idea where the input_generator is.

How can I solve this problem?
Thanks a lot!

retina_worker_only_demo running problem

Sorry for keep adding new issue, maybe this time I will leave this issue open until solving all the problems during running retina_worker_only_demo.py

After I turned to python3 environment to run the example code, the import part turns to cause errors, like

Traceback (most recent call last):
  File "/Aurel-retina-master/examples/retina_worker_only_demo/retina_worker_only_demo.py", line 28, in <module>
    import retina.retina as ret
  File "/Aurel-retina-master/retina/retina.py", line 16, in <module>
    from geometry.opticaxis import opticaxisFactory, RuleHexArrayMap, OpticAxisRule
ModuleNotFoundError: No module named 'geometry' 

So I add the required path by adding code

sys.path.append('/Aurel-retina-master/retina')
sys.path.append('/Aurel-retina-master/retina/screen')
sys.path.append('/Aurel-retina-master/retina/screen/map')
sys.path.append('/Aurel-retina-master/retina/screen/transform')
sys.path.append('/Aurel-retina-master/retina/vrf')
sys.path.append('/Aurel-retina-master/retina/vrf/utils')

to the head of retina_worker_only_demo.py

This did not solve the problem as when the code start to use neurokernel, import path still cause errors.

Starting retina simulation
Manager spawned
Traceback (most recent call last):
  File "/anaconda3/envs/nk/lib/python3.7/site-packages/neurokernel/mpi_backend.py", line 92, in <module>
    target, target_globals, kwargs = parent.recv()
  File "mpi4py/MPI/Comm.pyx", line 1438, in mpi4py.MPI.Comm.recv
  File "mpi4py/MPI/msgpickle.pxi", line 341, in mpi4py.MPI.PyMPI_recv
  File "mpi4py/MPI/msgpickle.pxi", line 306, in mpi4py.MPI.PyMPI_recv_match
  File "mpi4py/MPI/msgpickle.pxi", line 152, in mpi4py.MPI.pickle_load
  File "mpi4py/MPI/msgpickle.pxi", line 141, in mpi4py.MPI.cloads
  File "/anaconda3/envs/nk/lib/python3.7/site-packages/dill/_dill.py", line 327, in loads
    return load(file, ignore, **kwds)
  File "/anaconda3/envs/nk/lib/python3.7/site-packages/dill/_dill.py", line 313, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
  File "/anaconda3/envs/nk/lib/python3.7/site-packages/dill/_dill.py", line 525, in load
    obj = StockUnpickler.load(self)
  File "/anaconda3/envs/nk/lib/python3.7/site-packages/dill/_dill.py", line 515, in find_class
    return StockUnpickler.find_class(self, module, name)
  File "/Aurel-retina-master/retina/InputProcessors/RetinaInputProcessor.py", line 7, in <module>
    import retina.classmapper as cls_map
  File "/Aurel-retina-master/retina/classmapper.py", line 1, in <module>
    import screen.screen as scr
ModuleNotFoundError: No module named 'screen'
--------------------------------------------------------------------------
Child job 2 terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------

How can I solve the problem related to import path?


By the way, to overcome the problem
TypeError: add_node() takes 2 positional arguments but 3 were given
I changed the code in retina.py from

G_workers_nomaster.add_node(
                        neuron.id+'_photon',
                        {'class': 'BufferPhoton',
                        'name': '{}_buf'.format(name)
                    })

to

G_workers_nomaster.add_node(
                        neuron.id+'_photon',
                        **{'class': 'BufferPhoton',
                        'name': '{}_buf'.format(name)
                    })

I hope this will not cause bug in the future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.