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

AttributeError: module 'chess.pgn' has no attribute 'scan_offsets' #84

Open
CasellaJr opened this issue Dec 9, 2019 · 1 comment
Open

Comments

@CasellaJr
Copy link

CasellaJr commented Dec 9, 2019

Hello everyone

I want to run this project and see how works the training
When I run this: python src/chess_zero/run.py sl
I receive this:
2019-12-09 22:46:36,750@chess_zero.manager INFO # config type: mini ['C:\\Users\\Dell\\Desktop\\chess-alpha-zero-master\\data\\play_data\\ficsgamesdb_201901_standard2000_nomovetimes_103890.pgn'] Traceback (most recent call last): File "src/chess_zero/run.py", line 20, in <module> manager.start() File "src\chess_zero\manager.py", line 73, in start return sl.start(config) File "src\chess_zero\worker\sl.py", line 25, in start return SupervisedLearningWorker(config).start() File "src\chess_zero\worker\sl.py", line 55, in start games = self.get_games_from_all_files() File "src\chess_zero\worker\sl.py", line 79, in get_games_from_all_files games.extend(get_games_from_file(filename)) File "src\chess_zero\worker\sl.py", line 114, in get_games_from_file offsets = list(chess.pgn.scan_offsets(pgn)) AttributeError: module 'chess.pgn' has no attribute 'scan_offsets'

Browsing on Google, I found this link in which there is written: "chess.pgn.scan_headers() and chess.pgn.scan_offsets() have been removed. Instead the new functions chess.pgn.read_headers() and chess.pgn.skip_game() can be used for a similar purpose."

So, i went in src/chess-zero/worker and I tried to edit the sl file, replacing the function scan_offsets() with skip_game(), but i have a different error now:
2019-12-09 23:05:27,292@chess_zero.manager INFO # config type: mini ['C:\\Users\\Dell\\Desktop\\C0\\data\\play_data\\ficsgamesdb_201901_standard2000_nomovetimes_103890.pgn'] Traceback (most recent call last): File "src/chess_zero/run.py", line 20, in <module> manager.start() File "src\chess_zero\manager.py", line 73, in start return sl.start(config) File "src\chess_zero\worker\sl.py", line 25, in start return SupervisedLearningWorker(config).start() File "src\chess_zero\worker\sl.py", line 55, in start games = self.get_games_from_all_files() File "src\chess_zero\worker\sl.py", line 79, in get_games_from_all_files games.extend(get_games_from_file(filename)) File "src\chess_zero\worker\sl.py", line 114, in get_games_from_file offsets = list(chess.pgn.skip_game(pgn)) TypeError: 'bool' object is not iterable

What can I do?

@DailyMeme
Copy link

The issue you mentioned is also addressed in: #78
For now the solution is to downgrade python-chess (for me it's 0.23.10) until a way has been found to correctly rewrite it.

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