Я бегу по руководству для ИИ, который воспроизводит хлопотливую птицу на https://www.youtube.com/watch?v=NPbHUyVDYDw&list=PLzMcBGfZo4-lwGZWXz5Qgta_YNX3_vLS2&index=7.
По какой-то причине всякий раз, когда я запускаю его код, загруженный с 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'
Кажется, проблема возникает из этого блока кода:
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 the top-level object for a NEAT run.
p = neat.Population(config)
# Add a stdout reporter to show progress in the terminal.
p.add_reporter(neat.StdOutReporter(True))
stats = neat.StatisticsReporter()
p.add_reporter(stats)
#p.add_reporter(neat.Checkpointer(5))
# Run for up to 50 generations.
winner = p.run(eval_genomes, 50)
# show final stats
print('\nBest genome:\n{!s}'.format(winner))
if __name__ == '__main__':
# Determine path to configuration file. This path manipulation is
# here so that the script will run successfully regardless of the
# current working directory.
local_dir = os.path.dirname(__file__)
config_path = os.path.join(local_dir, 'config-feedforward.txt')
run(config_path)
Однако я посмотрел в документации Neat, найденной здесь , и там написано, что этот атрибутна самом деле существует. Я использую Pycharm на Mac, если это актуально. Кто-нибудь знает откуда берется ошибка?