【问题标题】:NEAT multiple genomes at once in one instance of pygame在 pygame 的一个实例中一次 NEAT 多个基因组
【发布时间】:2019-02-09 21:52:25
【问题描述】:

我正在使用整洁的 RNN 来训练用 pygame 完成的 flappy bird。

有人知道我该怎么做吗?

neat.ParallelEvaluator(4, eval_genome)

只需从pygame 打开四个窗口。

我想做类似this video的事情。

我能够在此处重新创建一些代码:link to GitHub,但在我的整个人口死亡后,我收到以下错误:

Traceback (most recent call last):
  File "C:/Users/Philipp/PycharmProjects/BallBounce/Main.py", line 64, in <module>
    winner = pop.run(eval_genomes, 50)
  File "C:\Users\Philipp\PycharmProjects\BallBounce\venv\lib\site-packages\neat\population.py", line 89, in run
    fitness_function(list(iteritems(self.population)), self.config)
  File "C:/Users/Philipp/PycharmProjects/BallBounce/Main.py", line 34, in eval_genomes
    genoinf,scoreinf = Game.game(genomes,config,SCORE) #game Returns fitness
TypeError: cannot unpack non-iterable NoneType object

【问题讨论】:

    标签: python machine-learning recurrent-neural-network neat


    【解决方案1】:

    我自己解决了这个问题。

    在我的代码中有一个愚蠢的print(),它基本上使每个时间段的代数翻倍

    喜欢:

    print(gen.append(bird.gen))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-17
      相关资源
      最近更新 更多