错误,模块整洁没有属性配置

问题描述

问题出在 config = neat.config.Config()。我已经安装好了,我在 Windows 上使用 Sublime。我查看了其他一些类似的问题,大多数人说要安装neat-python,但我有,而其他人则与pycharm有关。

def run(config_path):
    config = neat.config.Config(neat.DefaultGenome,neat.DefaultReproduction,neat.DefaultSpeciesSet,neat.DefaultStagnation,config_path)
    p = neat.Population(config)
    winner = p.run(main,50)

if __name__ == "__main__":
    local_dir = os.path.dirname(__file__)
    config_path = os.path.join(local_dir,"config-Feedforward.txt")
    run(config_path)

解决方法

你的配置太多了

import os
import neat
def run(config_path):
    neat.util.
    config = neat.Config(neat.DefaultGenome,neat.DefaultReproduction,neat.DefaultSpeciesSet,neat.DefaultStagnation,config_path)
    p = neat.Population(config)
    winner = p.run(main,50)

if __name__ == "__main__":
    local_dir = os.path.dirname(__file__)
    config_path = os.path.join(local_dir,"config-feedforward.txt")
    run(config_path)