AlexEne / AlexEne/CCrush-Bot

Problematic image array

Đang mở
#3 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
226
Fork
40
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I've got the following errors when running the code:

```
File “main.py”, line 165, in
main()
File “main.py”, line 152, in main
board_img = grab_board()
File “main.py”, line 97, in grab_board
game_board[y][x] = recognizer.predict(cell)
File “D:\python27\CCrush-Bot-master\sklearn_decoder.py”, line 80, in predict
return int(self.svc.predict(np_img))
File “D:\python27\lib\site-packages\sklearn\svm\base.py”, line 548, in predict

y = super(BaseSVC, self).predict(X)
File “D:\python27\lib\site-packages\sklearn\svm\base.py”, line 308, in predict

X = self._validate_for_predict(X)
File “D:\python27\lib\site-packages\sklearn\svm\base.py”, line 439, in _valida
te_for_predict
X = check_array(X, accept_sparse=’csr’, dtype=np.float64, order=”C”)
File “D:\python27\lib\site-packages\sklearn\utils\validation.py”, line 441, in
check_array
“if it contains a single sample.”.format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[ 52. 76. 96. … 105. 114. 126.].
Reshape your data either using array.reshape(-1, 1) if your data has a single fe
ature or array.reshape(1, -1) if it contains a single sample.
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.