我正在浏览使用此处找到的 NEAT 神经网络 API 播放飞扬小鸟的 AI 的指南。
当我运行他从 Github 下载的代码时,它给了我错误:
"Traceback (most recent call last):
File "test.py", line 438, in <module>
run(config_path)
File "test.py", line 412, in run
config = neat.config.Config(neat.DefaultGenome, neat.DefaultReproduction,
AttributeError: module 'neat' has no attribute 'config'
Run Code Online (Sandbox Code Playgroud)
问题似乎来自这段代码:
def run(config_file):
"""
runs the NEAT algorithm to train a neural network to play flappy bird.
:param config_file: location of config file
:return: None
"""
config = neat.config.Config(neat.DefaultGenome, neat.DefaultReproduction,
neat.DefaultSpeciesSet, neat.DefaultStagnation,
config_file)
# Create the population, which is …Run Code Online (Sandbox Code Playgroud) python config artificial-intelligence attributeerror neural-network