Using Brain without spiking neurons network?


#1

Hi
I’m Marco and I’d like to use the platform to make an experiment without using spiking neurons in the brain.
Essentially I need to create a connectionist network and link it to the robot. Is it possible in NRP?
Does exist any template of it ?

Thank you
Marco


#2

Hi Marco,

Remember to tag your NRP-related posts with Neurorobotics to make sure you get a reply :wink:

Yes it is possible to control a robot on the NRP without spiking networks. The workaround is to still have a brain file which does nothing. The transfer functions can have their own logic independently of the brain.

You can find an example of this in the experiment Benchmark Pioneer P3DX experiment

Cheers,
Jacques


#3

Hi Marco,

to add to the answer from jacques, you can use tensorflow in a transfer function.

cheers,
camilo


#4

Thank you very much for your help.
@camilo thank you too =)


#5

Hi @camilo,
did you recently install tensorflow in the NRP? We currently having issues with version conflicts. The tensorflow version does not like the protobuf version installed, but installing the protobuf version requested in the tensorflow venv did not solve the problem… If you could successfully install tensorflow, would be glad if you have any ideas how you resolved versions or what versions of tensorflow and protobuf actually worked for you.
Thanks!
Benedikt


#6

Hi @BenediktFeldotto,
We haven’t tried it in the latest version of the NRP.


#7

Hi @BenediktFeldotto,

Has this problem ever been solved, as I think I get a problem that might be related to that?

Following the instructions from this tutorial I do get the tensorflow to work in the shell with python and with ipython. It also runs when I enter the ~/.opt/platform_venv and try it there with the same python version that is used when running the Frontend.

However, when I try to run it through the Frontend in the Browser, I get a Error parsing message or descriptor problem.
Is this related to your problem?

If so, did you find a fix?
If not, am I doing something wrong?

Help would be much appreciated,
Annika


#8

Hi Annika,
did you activate the platform_venv virtual environment and could import tensorflow without error?
The errors are different from the ones we had… Can you please post your code in the Transfer Function that is leading to this error message, maybe you also find a little more detailed error description in the terminal you started the NRP in?

Best
Benedikt


#9

Hi @BenediktFeldotto,

Do I need to start the Platform from the terminal where I enter the active tensorflow environment?

In any case I think I get the same result. So the code I am trying to run in the Transferfunction for now does nothing but load the tensorflow:

@nrp.Robot2Neuron()
def tensor2(t):
    # import TensorFlow in the NRP, update this path for your local installation
    import site, os
    site.addsitedir(os.path.expanduser('/home/ansch/.opt/tensorflow_venv/lib/python2.7/site-packages'))
    import tensorflow     
    #clientLogger.info(t)

When I try to start the simulation the error in the Frontend is simply
Error parsing message **(Runtime)**

The terminal gives ofc a bit more information:

2020-01-15 17:30:52,898 [Thread-83 ] [hbp_nrp_cles] [ERROR] Error in Transfer Function (Runtime): Error parsing message
Traceback (most recent call last):
File “/home/ansch/Documents/NRP/CLE/hbp_nrp_cle/hbp_nrp_cle/tf_framework/_TransferFunction.py”, line 261, in run
return self._func(*self._params)
File “”, line 8, in tensor2
File “/home/ansch/.opt/tensorflow_venv/lib/python2.7/site-packages/tensorflow/init.py”, line 99, in
from tensorflow_core import *
File “/home/ansch/.opt/tensorflow_venv/lib/python2.7/site-packages/tensorflow_core/init.py”, line 33, in
from tensorflow._api.v1 import audio
File “/home/ansch/.opt/tensorflow_venv/lib/python2.7/site-packages/tensorflow_core/_api/v1/audio/init.py”, line 10, in
from tensorflow.python.ops.gen_audio_ops import decode_wav
File “/home/ansch/.opt/tensorflow_venv/lib/python2.7/site-packages/tensorflow_core/python/ops/gen_audio_ops.py”, line 609, in
_op_def_lib = _InitOpDefLibrary(b"\np\n\020AudioSpectrogram\022\t\n\005input\030\001\032\017\n\013spectrogram\030\001"\022\n\013window_size\022\003int"\r\n\006stride\022\003int"\035\n\021magnitude_squared\022\004bool\032\002(\000\n\200\001\n\tDecodeWav\022\014\n\010contents\030\007\032\t\n\005audio\030\001\032\017\n\013sample_rate\030\003"$\n\020desired_channels\022\003int\032\013\030\377\377\377\377\377\377\377\377\377\001"#\n\017desired_samples\022\003int\032\013\030\377\377\377\377\377\377\377\377\377\001\n5\n\tEncodeWav\022\t\n\005audio\030\001\022\017\n\013sample_rate\030\003\032\014\n\010contents\030\007\n\311\001\n\004Mfcc\022\017\n\013spectrogram\030\001\022\017\n\013sample_rate\030\003\032\n\n\006output\030\001"%\n\025upper_frequency_limit\022\005float\032\005%\000\000zE"%\n\025lower_frequency_limit\022\005float\032\005%\000\000\240A"#\n\030filterbank_channel_count\022\003int\032\002\030(" \n\025dct_coefficient_count\022\003int\032\002\030\r")
File “/home/ansch/.opt/tensorflow_venv/lib/python2.7/site-packages/tensorflow_core/python/ops/gen_audio_ops.py”, line 491, in _InitOpDefLibrary
op_list.ParseFromString(op_list_proto_bytes)
DecodeError: Error parsing message
2020-01-15 17:34:54,794 [Thread-5 ] [hbp_nrp_back] [INFO] Start cleanup

I can however not really get behind what this is supposed to mean. I have tried messing around a bit with the code where it gives the error, but of course then if just gets stuck on the next line and that is surely not the solution.

Does that look like something you can help me with?

Thank you,
Annika


#10

Hi Annika,
the platform does not need to run from the activated platform_venv it does find the packages automatically.

For the tensorflow issues, I suggest downgrading tensorflow as we discussed.

Best
Benedikt