open_spiel
open_spiel copied to clipboard
error when using python games with C++ CFR algorithm
I get an error bad_weak_ptr
when I try to use python games with C++ CFR. I'm 99% sure this used to work, but sometime over the past half-year it stopped working.
Tested on both Mac OS and Ubuntu with a fresh install:
>>> import pyspiel
>>> from open_spiel.python.games import kuhn_poker
>>> pyspiel.CFRSolver(kuhn_poker.KuhnPokerGame())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: bad_weak_ptr
>>> pyspiel.CFRSolver(pyspiel.load_game("python_kuhn_poker"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: bad_weak_ptr
Weird... I would have expected this bug to apply to all C++ algorithms, but it looks like pyspiel.exploitability
works (as tested in the kuhn_poker_test.py). So it's just the CFR algorithms that break?
Hmm, I am not sure what's going on. I'll look into it. Tagging @elkhrt as I'm sure I will need his help on this.
Thanks y'all! I also tested pyspiel.CFRBRSolver
, pyspiel.OutcomeSamplingMCCFRSolver
, and pyspiel.ExternalSamplingMCCFRSolver
and confirmed that they give me the same error.
but pyspiel.TabularBestResponse
and pyspiel.exploitability
seem to work just fine.
Quick update that we are looking into it (and believed we have found the cause ... and by "we" I mean @elkhrt :)). We hope to have a fix out within the next few weeks.
Thanks @elkhrt!