Skip to content
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

Deep CFR notebook build fail on google colab #1305

Open
koetje07 opened this issue Jan 30, 2025 · 4 comments
Open

Deep CFR notebook build fail on google colab #1305

koetje07 opened this issue Jan 30, 2025 · 4 comments

Comments

@koetje07
Copy link

Hello

In the deep cfr pytorch notebook I tried to run the code up to

#@title
!./install.sh
!pip install -r requirements.txt;
!mkdir -p /usr/local/open_spiel/build
%cd /usr/local/open_spiel/build
!CXX=g++ cmake -DPython_TARGET_VERSION=3.6 -DCMAKE_CXX_COMPILER=${CXX} ../open_spiel;
!make -j$(nproc);

but then i got an error:

[ 39%] Building CXX object games/CMakeFiles/games.dir/dark_hex/dark_hex.cc.o
In file included from /usr/local/open_spiel/open_spiel/../open_spiel/games/dark_hex/dark_hex.h:25,
from /usr/local/open_spiel/open_spiel/games/dark_hex/dark_hex.cc:15:
/usr/local/open_spiel/open_spiel/../open_spiel/games/hex/hex.h:105:13: error: declaration of ‘open_spiel::hex::StringRep open_spiel::hex::HexState::StringRep() const’ changes meaning of ‘StringRep’ [-fpermissive]
105 | StringRep StringRep() const { return string_rep_; }
| ^~~~~~~~~
/usr/local/open_spiel/open_spiel/../open_spiel/games/hex/hex.h:76:12: note: ‘StringRep’ declared here as ‘enum class open_spiel::hex::StringRep’
76 | enum class StringRep {
| ^~~~~~~~~
[ 39%] Building CXX object algorithms/CMakeFiles/algorithms.dir/tabular_exploitability.cc.o
cc1plus: note: unrecognized command-line option ‘-Wno-everything’ may have been intended to silence earlier diagnostics
make[2]: *** [games/CMakeFiles/games.dir/build.make:471: games/CMakeFiles/games.dir/dark_hex/dark_hex.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:10026: games/CMakeFiles/games.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 39%] Building CXX object algorithms/CMakeFiles/algorithms.dir/tabular_q_learning.cc.o
[ 39%] Building CXX object algorithms/CMakeFiles/algorithms.dir/tabular_sarsa.cc.o
[ 39%] Building CXX object algorithms/CMakeFiles/algorithms.dir/tensor_game_utils.cc.o
[ 40%] Building CXX object algorithms/CMakeFiles/algorithms.dir/trajectories.cc.o
[ 40%] Building CXX object algorithms/CMakeFiles/algorithms.dir/value_iteration.cc.o
[ 40%] Built target algorithms
make: *** [Makefile:101: all] Error 2

chatgpt says it stems from a c++ naming conflict in the hex.h file.

I remember running the code a weeks ago and it ran fine then.

@koetje07 koetje07 changed the title Deep CFR colab build fail on google colab Deep CFR notebook build fail on google colab Jan 30, 2025
@koetje07
Copy link
Author

ah yes I did !pip install open_spiel instead and that worked.

@koetje07
Copy link
Author

When I run the code on a local virtualbox parrot OS 6.2 (debian based) distro in a jupyter lab notebook I can run the code in the original deep cfr notebook (so no build issues) but when i get to from open_spiel.python.algorithms.deep_cfr import AdvantageMemory, StrategyMemory, ReservoirBuffer the kernel always crashes. Seems to only crash when importing that specific line, but I don't get this error in a google colab nb.

@lanctot
Copy link
Collaborator

lanctot commented Feb 1, 2025

Oh that notebook is very hold (we don't build OpenSpiel from source anymore, I think it's been more than 2 years). It should be removed. I'll do that this week.

You should use the new colab linked from the main page: https://colab.research.google.com/github/deepmind/open_spiel/blob/master/open_spiel/colabs/install_open_spiel.ipynb

and then copy what you need from one of the examples in here: https://github.com/google-deepmind/open_spiel/tree/master/open_spiel/python/examples

@koetje07
Copy link
Author

koetje07 commented Feb 2, 2025

okay. I noticed the python/algos/deepcfr.py code implements deep cfr in tensorflow, do you think there are any performance differences or is this negligible compared to the pytorch implementation?

Also thank you for creating open spiel, I spent 2 weeks developing something that ultimately had to become something similar to open spiel before discovering it so you saved me months of work lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants