Neat-Python: AttributeError: module 'neat' has no attribute 'Config'
Neat-Python: AttributeError: module 'neat' has no attribute 'Config'
我在 visual studio 代码上使用 neat-python 版本 0.92 和 python 版本 3.9.5(64 位)时遇到问题。我不断收到错误:
AttributeError: module 'neat' has no attribute 'Config'
错误来自
def run(config_file):
# Load the config file, which is assumed to live in
# the same directory as this script.
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
neat.DefaultSpeciesSet, neat.DefaultStagnation,
config_file)
pop = neat.Population(config)
stats = neat.StatisticsReporter()
pop.add_reporter(stats)
pop.add_reporter(neat.StdOutReporter(True))
pe = neat.ParallelEvaluator(multiprocessing.cpu_count(), eval_genome)
winner = pop.run(pe.evaluate)
# Save the winner.
with open('winner', 'wb') as f:
pickle.dump(winner, f)
print(winner)
if __name__ == '__main__':
local_dir = os.path.dirname(__file__)
config_path = os.path.join(local_dir, 'config-feedforward')
run(config_path)
更具体地说:
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
neat.DefaultSpeciesSet, neat.DefaultStagnation,
config_file)
我已经尝试重新安装 neat-python 但我没有 运行 just neat 这在另一个问题中得到了回答。
我使用 pip uninstall neat-python
卸载了 neat-python,然后使用 github
上的源代码手动重新安装了它
我在 visual studio 代码上使用 neat-python 版本 0.92 和 python 版本 3.9.5(64 位)时遇到问题。我不断收到错误:
AttributeError: module 'neat' has no attribute 'Config'
错误来自
def run(config_file):
# Load the config file, which is assumed to live in
# the same directory as this script.
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
neat.DefaultSpeciesSet, neat.DefaultStagnation,
config_file)
pop = neat.Population(config)
stats = neat.StatisticsReporter()
pop.add_reporter(stats)
pop.add_reporter(neat.StdOutReporter(True))
pe = neat.ParallelEvaluator(multiprocessing.cpu_count(), eval_genome)
winner = pop.run(pe.evaluate)
# Save the winner.
with open('winner', 'wb') as f:
pickle.dump(winner, f)
print(winner)
if __name__ == '__main__':
local_dir = os.path.dirname(__file__)
config_path = os.path.join(local_dir, 'config-feedforward')
run(config_path)
更具体地说:
config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
neat.DefaultSpeciesSet, neat.DefaultStagnation,
config_file)
我已经尝试重新安装 neat-python 但我没有 运行 just neat 这在另一个问题中得到了回答。
我使用 pip uninstall neat-python
卸载了 neat-python,然后使用 github