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

Error when training: ValueError: setting an array element with a sequence. #10

Open
kantajitshaw opened this issue Feb 23, 2017 · 5 comments

Comments

@kantajitshaw
Copy link

I was running test-object-detector in bin.
It gives me following error:

Training a Linear SVM Classifier
Traceback (most recent call last):
File "../object-detector/train-classifier.py", line 48, in
clf.fit(list(np.array(fds)), labels)
File "/usr/local/lib/python2.7/dist-packages/sklearn/svm/base.py", line 151, in fit
X, y = check_X_y(X, y, dtype=np.float64, order='C', accept_sparse='csr')
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 521, in check_X_y
ensure_min_features, warn_on_dtype, estimator)
File "/usr/local/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 382, in check_array
array = np.array(array, dtype=dtype, order=order, copy=copy)
ValueError: setting an array element with a sequence.

Please fix this issue.

@akane999
Copy link

Hi,
hog function returns 2 values, so you have to change the line 45 and 55 of extract-features.py with this line
fd,hogimage = hog(im, orientations, pixels_per_cell, cells_per_block, visualize, normalize)

@hotessy
Copy link

hotessy commented Aug 18, 2017

@kantajit did your code work with this solution ?

@akane999
Copy link

Yes, that worked.

@azureway
Copy link

@akane999 I did the same thing as you said corresponding to the same issue. But I got the error shown as below:
Traceback (most recent call last):
File "../object-detector/extract-features.py", line 58, in
fd,hogimage = hog(im, orientations, pixels_per_cell, cells_per_block, visualize, normalize)
ValueError: too many values to unpack

If I change back, it game me the previous error again. Any advise? thanks

@akane999
Copy link

akane999 commented Aug 28, 2017 via email

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

4 participants