Open cdemirkiran opened 2 years ago
In case of parallel operation, I think a single genome comes to the function, try it as if there is a single genome without putting it into the for loop.
https://gitlab.com/lucasrthompson/Sonic-Bot-In-OpenAI-and-NEAT/-/blob/master/neat-paralle-sonic.py Şu kaynakta paralelize edilmiş halde Worker lara tek bir gen gönderilmiş. Ayrıca discordtan ( MAJIN#4884 ) ekleyebilirsen beni konuşabiliriz , bende tam çözmedim bu kütüphaneyi :)
When I am trying to run with parallel evaluation, I receive the error below. The way I call it:
`def eval_genomes(genomes, config): for genome_id, genome in genomes: genome.fitness = 4.0 net = neat.nn.FeedForwardNetwork.create(genome, config) outputs = [] for inp, out in tuple_from_file(TRAIN_DATA): outputs.append([net.activate(inp), out]) genome.fitness += get_fitness(outputs)
def run(config_file): config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction, neat.DefaultSpeciesSet, neat.DefaultStagnation, config_file)
And the error:
` ** Running generation 0 **
multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "tryneat.py", line 15, in eval_genomes for genome_id, genome in genomes: TypeError: 'DefaultGenome' object is not iterable """
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "tryneat.py", line 80, in
run(config_path)
File "tryneat.py", line 41, in run
winner = p.run(parallel_evaluator.evaluate, 300)
File "venv/lib/python3.9/site-packages/neat/population.py", line 89, in run
fitness_function(list(iteritems(self.population)), self.config)
File "venv/lib/python3.9/site-packages/neat/parallel.py", line 30, in evaluate
genome.fitness = job.get(timeout=self.timeout)
File "/usr/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
TypeError: 'DefaultGenome' object is not iterable`