Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 人口规模为1时除以零_Python 3.x_Machine Learning_Neat - Fatal编程技术网

Python 3.x 人口规模为1时除以零

Python 3.x 人口规模为1时除以零,python-3.x,machine-learning,neat,Python 3.x,Machine Learning,Neat,注意:我提交了,但查看了他们的GitHub,但似乎没有人会根据提交的其他问题进行回复 File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\neat\math_util.py", line 9, in mean return sum(map(float, values)) / len(values) ZeroDivisionError: division by zero 当我的模型的总

注意:我提交了,但查看了他们的GitHub,但似乎没有人会根据提交的其他问题进行回复

File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\neat\math_util.py", line 9, in mean
    return sum(map(float, values)) / len(values)
ZeroDivisionError: division by zero
当我的模型的总体大小设置为1时,我会收到一个0除错误,当设置为一个大于1的数字时,我不会得到错误。我发现了一个与此相关的堆栈溢出页面,但没有解决方案

以下是我的一些代码: 配置文件(重要部分):

评估/健身功能:

def main(gnomes, config):
    global net, ge
    net = neat.nn.FeedForwardNetwork(gnomes[0], config)
    ge = gnomes[0]
    ge.fitness = 0
如果您有解决方案或需要更多代码,请这样说

整体回溯:

 ****** Running generation 0 ******

Process Process-1:
Traceback (most recent call last):
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
    self.run()
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\Python37\lib\multiprocessing\process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\setup_manager.py", line 655, in run_agent
    bm.run()
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\botmanager\bot_manager.py", line 196, in run
    self.load_agent()
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\botmanager\bot_manager.py", line 117, in load_agent
    self.agent = agent_class(self.name, self.team, self.index)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\MyBots\learnie\src\bot.py", line 40, in __init__
    run(config_path)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\MyBots\learnie\src\bot.py", line 30, in run
    winner = p.run(main)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\neat\population.py", line 89, in run
    fitness_function(list(iteritems(self.population)), self.config)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\MyBots\learnie\src\bot.py", line 18, in main
    net = neat.nn.FeedForwardNetwork(gnomes[0], config)
TypeError: __init__() missing 1 required positional argument: 'node_evals'
uninitialized_bot error reading header: An existing connection was forcibly closed by the remote host

请提供完整的错误跟踪信息,以及导致错误的代码行。我将其编辑为包含回溯。导致错误的代码行位于eval函数中。您添加错误跟踪的原因是您没有使用
net=neat.nn.FeedForwardNetwork.create(gnomes[0],config)
,如果您仍然存在该问题,请显示除零的完整错误跟踪首先检查它是否可以解决您的问题请提供完整的错误跟踪信息,导致错误的代码行我将其编辑为包含回溯导致错误的代码行在eval函数中添加错误跟踪的原因是您没有使用
net=neat.nn.FeedForwardNetwork.create(gnomes[0],config)
,如果您仍然有问题,请显示除零完整错误跟踪。首先检查它是否可以解决您的问题
 ****** Running generation 0 ******

Process Process-1:
Traceback (most recent call last):
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
    self.run()
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\Python37\lib\multiprocessing\process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\setup_manager.py", line 655, in run_agent
    bm.run()
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\botmanager\bot_manager.py", line 196, in run
    self.load_agent()
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\rlbot\botmanager\bot_manager.py", line 117, in load_agent
    self.agent = agent_class(self.name, self.team, self.index)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\MyBots\learnie\src\bot.py", line 40, in __init__
    run(config_path)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\MyBots\learnie\src\bot.py", line 30, in run
    winner = p.run(main)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\neat\population.py", line 89, in run
    fitness_function(list(iteritems(self.population)), self.config)
  File "C:\Users\hunty\AppData\Local\RLBotGUIX\MyBots\learnie\src\bot.py", line 18, in main
    net = neat.nn.FeedForwardNetwork(gnomes[0], config)
TypeError: __init__() missing 1 required positional argument: 'node_evals'
uninitialized_bot error reading header: An existing connection was forcibly closed by the remote host