Open realimposter opened 5 years ago
Did you ever find a solution to this? I am getting the same AssertionError.
I found a solution! Replace the definition of the function get_new_node_key()
in genome.py with this:
def get_new_node_key(self, node_dict):
if self.node_indexer is None:
self.node_indexer = count(max(list(iterkeys(node_dict))) + 1)
new_id = next(self.node_indexer)
if new_id in node_dict:
new_id = next(self.node_indexer)
return new_id
I still have an unrelated issue where NEAT stops learning though.
I found a solution! Replace the definition of the function
get_new_node_key()
in genome.py with this:def get_new_node_key(self, node_dict): if self.node_indexer is None: self.node_indexer = count(max(list(iterkeys(node_dict))) + 1) new_id = next(self.node_indexer) if new_id in node_dict: new_id = next(self.node_indexer) return new_id
I still have an unrelated issue where NEAT stops learning though.
It looks better if you replace "if new_id in node_dict" with while
I'm using neat-python inside of the program Houdini. I am trying to train biped movements. The program runs great until at a random generation usually between 4 and 100 where the the organisms stop reproducing. I tracked the problem down to the species members list suddenly being empty, because the reproduce function stops at the assert line in this code in genome.py:
` def get_new_node_key(self, node_dict):
Anyone know whats causing this?