-
-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Engine.play fails and crashes with CrazyAra (UCI) #627
Comments
Can you please include debug logs? They might contain a hint. |
Here it is:
|
I think the order of commands being sent is wrong, if I manually run CrazyAra and issue ucinewgame before isready it crashes and throws segfault error too, but doing isready first (to load the neural net) and then ucinewgame works and outputs: |
So I went to engine.py file and in play() function manually changed order or calling _ucinewgame and _isready and now the code executed further but crashed with this error
|
Thank you @shubhank008 for figuring this out. Your last error arises from the fact that release 0.8.0 does not support classical chess yet and only supports crazyhouse unfortunately. import chess
import chess.engine
import chess.variant
import os
os.chdir("/root/CrazyAra_0.8.0_Linux_MKL/")
engine = chess.engine.SimpleEngine.popen_uci("/root/CrazyAra_0.8.0_Linux_MKL/CrazyAra")
## For CPU, comment if want to use GPU
engine.configure({"Context": "cpu"})
board = chess.variant.CrazyhouseBoard()
while not board.is_game_over():
result = engine.play(board, chess.engine.Limit(time=0.1))
board.push(result.move)
engine.quit() One exemplary project where CrazyAra was running successfully in combination with Note, however that lichess-bot runs with python-chess 0.24.1. |
Meanwhile calling |
woah the man himself :D And yes it seems I should have read the release notes more carefully as they do mention 0.8 is for crazyhouse only. Any plans for classic for 0.8/0.9 or 0.7 is good enough (asking cause there were some huge improvements mentioned for memory and loadtimes in 0.8 or were they for crazyhouse only ?) tldr: I just want to use CrazyAra in classic chess and not Crazyhouse (not yet anyway) |
@QueensGambit does 0.7 also not support classic chess ? Because same variant error in 0.7 too |
@QueensGambit so I deleted 0.8 and downloaded 0.7 and changed my code to use However, even with that I got same error as above for variant. Then I changed the board code to variant option like you mentioned to Crazyhouse and the code is running now and the engine is playing against itself (engine vs engine) and I can even see it. So does even 0.7 also not support classic chess or is it intentionally so to play classic chess through python-chess we need to still use Crazyhouse variant ? My current code:
|
@shubhank008 Nice, to hear that the code is running with Yes, CrazyAra <= 0.8.0 only supports crazyhouse so far. You can find an independent comparison between different versions and engines here: For release 0.9.0, I plan to support additional chess variants. |
@QueensGambit maybe its due to my lack of understanding, but does no version or model of CrazyAra supports classic/normal chess ? I tried 0.7 and 0.6 yet both had same error and although the board runs using variant option it plays Crazyhouse while I wanted to do normal chess. |
All available releases for CrazyAra (<= 0.8.0) still only support Crazyhouse. However, the code base of MCTS is setup to easily support additional variants in the future. Alternatively, one could use the position representation of Fairy-Stockfish to further allow Asian chess variants (e.g. shogi, xiangqi, janggi, ...). The main thing which is still missing are neural network models for each variant. Currently, we also add Pommerman, a non-chess game, as a state interface: If you are only interested in classical chess, you might want to use official Stockfish or Lc0 in the meantime. |
Using the example code from the docs for CrazyAra engine (UCI support) crashes the python script as soon as engine.play is called.
Error:
Running and use other manual commands like board, print(board), push_move, legal_moves, etc. still works just trying to do a engine vs engine play fails.
The text was updated successfully, but these errors were encountered: