AlexEne / AlexEne/CCrush-Bot

Problematic image array

Offen
#3 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
226
Forks
40
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.