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

Erorr while running test-classifier.py #1

Open
alwansm opened this issue Mar 23, 2018 · 2 comments
Open

Erorr while running test-classifier.py #1

alwansm opened this issue Mar 23, 2018 · 2 comments

Comments

@alwansm
Copy link

alwansm commented Mar 23, 2018

Hello I am reciving the following error :

Traceback (most recent call last):
File "test-classifier.py", line 69, in
pred = clf.predict(fd)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\sklearn\linear_model\base.py", line 324, in predict
scores = self.decision_function(X)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\sklearn\linear_model\base.py", line 300, in decision_function
X = check_array(X, accept_sparse='csr')
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\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=[0. 0. 0. ... 0. 0. 0.].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

@CarkusL
Copy link

CarkusL commented May 15, 2018

so am I

@CarkusL
Copy link

CarkusL commented May 15, 2018

you can add fd = fd.reshape(1,-1) before pred = clf.predict(fd) which is the line 69 of test-classifier.py

https://github.com/yjl9122/object-detector-master/blob/5baa2d715b7c7a69a33328ef01f67d0af3c0b682/object-detector/test-classifier.py#L69

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