kevaday / alphazero-general

A fast, generalized, and modified implementation of Deepmind's distinguished AlphaZero in PyTorch.
MIT License
66 stars 21 forks source link

Self-play - ValueError: Invalid action encountered while updating root #31

Open SootyOwl opened 1 year ago

SootyOwl commented 1 year ago

Hi,

Attempting to use this as instructed (subclassing GameState) seems to work at first, but during the self-play step the console is filled with the same errors:

Exception ignored in: 'alphazero.MCTS.MCTS.update_root'
Traceback (most recent call last):
  File "/home/tyto/miniconda3/envs/torch/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
ValueError: Invalid action encountered while updating root: 155
ValueError: Invalid action encountered while updating root: 91
Bobingstern commented 1 year ago

Make sure your env has the termination conditions set properly. Thats what usually causes this issue since it's trying to search through invalid positions.