erikbern / deep-pink

Deep Pink is a chess AI that learns to play chess using deep learning.
http://erikbern.com/2014/11/29/deep-learning-for-chess/
813 stars 159 forks source link

AssertionError - assert(gn_current.board().turn == 0) #6

Open rayexar opened 8 years ago

rayexar commented 8 years ago

I'm getting AssertionErrors when trying to run play.py, with the output looking like this:

maxd 1.000000 maxn 278.426311
Traceback (most recent call last):
  File "C:\Users\Lol\Desktop\deep-pink-master\deep-pink-master\play.py", line 226, in game
    gn_current = player.move(gn_current)
  File "C:\Users\Lol\Desktop\deep-pink-master\deep-pink-master\play.py", line 119, in move
    assert(gn_current.board().turn == 0)
AssertionError

and keeps repeating itself. Any idea on how to fix this?

erikbern commented 8 years ago

The model can only play one of the sides (i don't remember which but I think black)

Are you running it off the shelf or did you make any modifications? I haven't touched this code in a year+ so I don't remember exactly how it works

rayexar commented 8 years ago

I'm running it off the shelf. It looks like with sunfish the player plays as white by default (although the pieces are displayed as black for some reason).

vyasgiridhar commented 8 years ago

How did you solve the infinite assersion errors? @rayexar

rayexar commented 8 years ago

@vyasgiridhar I didn't manage to fix that...

vyasgiridhar commented 8 years ago

@rayexar I found the mistake The problem is at gn_current.board().turn. It returns a boolean, not a integer.

erikbern commented 8 years ago

great if you want to submit a pull request and fix it

erikbern commented 8 years ago

just do assert(not gn_current.board()) should be enough