feagi / brain-visualizer

0 stars 1 forks source link

Sends vector when update patterns in BV #185

Closed Kakcalu13 closed 2 months ago

Kakcalu13 commented 2 months ago
**2024-04-14 12:07:51,170:INFO:api.api:log_requests:88:rid=9A0EWB start request path=/v1/morphology/morphology
**************************************************
 {'update_morphology_properties': {'name': 'test_morph', 'type': 'vectors', 'class': 'custom', 'parameters': {'patterns': [[[0, 0, 0], [25, 0, 0]]]}}}
2024-04-14 12:07:51,172:INFO:api.api:log_requests:95:rid=9A0EWB completed_in=1.90ms status_code=200
INFO:     127.0.0.1:52051 - "PUT /v1/morphology/morphology HTTP/1.1" 200 OK
<><><><><>   <><><><> Impacted areas [['C8Gtes', 'o__ser']]
C8Gtes o__ser
++++++ 3
Error during synaptogenesis of C8Gtes and o__ser
Traceback (most recent call last):
  File "/Users/bwuk/feagi/src/../src/evo/synaptogenesis_rules.py", line 96, in neighbor_finder
    for vector in runtime_data.genome["neuron_morphologies"][neuron_morphology]["parameters"]["vectors"]:
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'vectors'

genome is saved**

Repo using barebones:

1) Add servo opu (2x0x10 2) Add custom cortical (name whatever u want) 3) Create a new morph using patterns. 0-0-0 to 0-0-0 4) Map custom cortical to servo opu on the new morph 5) go to the new morph you created, add new rule 0-0-0 to 1-0-0 See the error on FEAGI

Kakcalu13 commented 2 months ago

Confirmed that this is on genome-physiology and independent_core

Amir-Rasteg commented 2 months ago

the dictionary sent was this:

{'update_morphology_properties': {'name': 'dddddddd', 'type': 'vectors', 'class': 'custom', 'parameters': {'patterns': [[[0, 0, 0], [0, 0, 0]], [[0, 0, 0], [1, 0, 0]]]}}}

Seems to have the patterns parameter to me. this is also visible in your example.

@m-nadji-tehrani this may be a feagi side issue? The error suggest feagi is searching for a "vectors" parameter

Kakcalu13 commented 2 months ago

{'update_morphology_properties': {'name': 'dddddddd', 'type': 'vectors', 'class': 'custom', 'parameters': {'patterns': [[[0, 0, 0], [0, 0, 0]], [[0, 0, 0], [1, 0, 0]]]}}}

the type should be patterns. At first, I thought it was FEAGI too but I reload using the barebones and it displays the pattern. See here: image

without any modifications

Which is what this caused FEAGI crash nonstop due to this:

 {'update_morphology_properties': {'name': '0_0_0-7_0_0', 'type': 'vectors', 'class': 'custom', 'parameters': {'patterns': [[[0, 0, 0], [7, 0, 0]], [[0, 0, 0], [0, 0, 0]]]}}}
2024-04-15 10:57:46,044:INFO:api.api:log_requests:95:rid=S6JJ5F completed_in=5.45ms status_code=200
INFO:     127.0.0.1:47638 - "PUT /v1/morphology/morphology HTTP/1.1" 200 OK
<><><><><>   <><><><> Impacted areas []
Traceback (most recent call last):
  File "/home/bwuk/feagi/src/../src/evo/x_genesis.py", line 450, in update_morphology_properties
    save_genome(genome=genome_v1_v2_converter(runtime_data.genome),
  File "/home/bwuk/feagi/src/../src/evo/genome_editor.py", line 66, in save_genome
    data_file.write(json.dumps(data, indent=3, default=set_default))
  File "/usr/lib/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/lib/python3.8/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/lib/python3.8/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/home/bwuk/feagi/src/../src/evo/genome_editor.py", line 38, in set_default
    raise TypeError
TypeError
Error during morphology update
  None

 {'update_morphology_properties': {'name': '0_0_0-7_0_0', 'type': 'vectors', 'class': 'custom', 'parameters': {'patterns': [[[0, 0, 0], [7, 0, 0]], [[0, 0, 0], [0, 0, 0]]]}}}
2024-04-15 10:57:46,044:INFO:api.api:log_requests:95:rid=S6JJ5F completed_in=5.45ms status_code=200
INFO:     127.0.0.1:47638 - "PUT /v1/morphology/morphology HTTP/1.1" 200 OK
<><><><><>   <><><><> Impacted areas []
Traceback (most recent call last):
  File "/home/bwuk/feagi/src/../src/evo/x_genesis.py", line 450, in update_morphology_properties
    save_genome(genome=genome_v1_v2_converter(runtime_data.genome),
  File "/home/bwuk/feagi/src/../src/evo/genome_editor.py", line 66, in save_genome
    data_file.write(json.dumps(data, indent=3, default=set_default))
  File "/usr/lib/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/lib/python3.8/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/lib/python3.8/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.8/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/home/bwuk/feagi/src/../src/evo/genome_editor.py", line 38, in set_default
    raise TypeError
TypeError
Error during morphology update
  None

which I faced this quite frequently.

Amir-Rasteg commented 2 months ago

vectors

not sure how I missed the vectors in the middle

Pushed fix now BV side

Kakcalu13 commented 2 months ago

confirmed fixed