Skip to content

ZeroDivisionError: float division by zero #191

@mshanak

Description

@mshanak

I am trying to run this code on a customer game, The experiment works for some iterations but then but I keep getting the following error:


Traceback (most recent call last):
  File "main.py", line 61, in <module>
    main()
  File "main.py", line 57, in main
    c.learn()
  File ".../alpha-zero-general-master/Coach.py", line 89, in learn
    iterationTrainExamples += self.executeEpisode()
  File "... /alpha-zero-general-master/Coach.py", line 58, in executeEpisode
    pi = self.mcts.getActionProb(canonicalBoard, temp=temp)
  File ".... /alpha-zero-general-master/MCTS.py", line 56, in getActionProb
    probs = [x / counts_sum for x in counts]
  File "...alpha-zero-general-master/MCTS.py", line 56, in <listcomp>
    probs = [x / counts_sum for x in counts]
ZeroDivisionError: float division by zero


The configuration arguments in main.py are as follow:


args = dotdict({
    'numIters': 1000,
    'numEps': 100,              # Number of complete self-play games to simulate during a new iteration.
    'tempThreshold': 15,        #
    'updateThreshold': 0.6,     # During arena playoff, the new neural net will be accepted if threshold or more of games are won.
    'maxlenOfQueue': 200000,    # Number of game examples to train the neural networks.
    'numMCTSSims': 50,          # Number of games moves for MCTS to simulate.
    'arenaCompare': 40,         # Number of games to play during arena play to determine if new net will be accepted.
    'cpuct': 1,

    'checkpoint': './temp/',
    'load_model': False,
    'load_folder_file': ('/dev/models/8x100x50','best.pth.tar'),
    'numItersForTrainExamplesHistory': 20,

})




Is there any solution or explanation for counts_sum zero value?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions