Comments (3)
sorry no idea, but if you figure out feel free to send over a PR!
from deep-pink.
I think this is related to Issue #11
By going back to python-chess 0.8.3 it seems to work.
In recent versions pieces is no longer iterable in bb2array()
from deep-pink.
I was having the same issue and, assuming my understanding of the original loop is correct, I may have a work around for python-chess 0.9.0 and newer.
This pretty much just walks through the board square by square (0 to 63) and does the calculations when it finds a piece.
`
python-chess 0.9.0 work around
board_pos = 0
# looping through each row
for row in range(0, 8):
# looping through each column
for col in range(0, 8):
# getting the Piece at the current position
piece = b.piece_at(board_pos)
# Checking that there is actually a piece at the current position
if piece is not None:
# getting the integer value of the piece (between 1 and 6)
piece_val = piece.piece_type
# getting the color of the piece
color = int(piece.color)
if flip:
row = 7 - row
color = 1 - color
piece_val = color * 7 + piece_val
x[row * 8 + col] = piece_val
board_pos += 1
`
There may be a better/more efficient way to do this, I just wanted to come up with a quick work around. I'm still fairly new to Python so if there's anything that I should fix or improve in that loop let me know!
Edit:
Also, as brianpirchanderson pointed out, I believe this should be the same issue as #11
from deep-pink.
Related Issues (19)
- Sunfish search error HOT 19
- compatible with python-chess 0.8.3 HOT 3
- h5py installation
- Why game move is too slow? HOT 1
- Deep Pink GUI and Chess Engine HOT 1
- Updated installation instructions
- Error loading pickle file : Multiarray module not found HOT 1
- The system cannot find the path specified: '/mnt/games/*.* HOT 5
- Use pylearn2 for the training process HOT 1
- New branch with Python3 support and Dockerfile HOT 2
- float division by zero HOT 3
- Loss function seems incorrect?? HOT 1
- Missing INSTALL.md HOT 2
- Installing dependencies. HOT 4
- Downloading Some Dependencies resulted in Pygame not working anymore HOT 2
- AssertionError - assert(gn_current.board().turn == 0) HOT 7
- A Doubt HOT 1
- The Blog Link is not suitably linked.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-pink.