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

run boss_train.py error #20

Closed
asd51731 opened this issue Mar 12, 2017 · 1 comment
Closed

run boss_train.py error #20

asd51731 opened this issue Mar 12, 2017 · 1 comment

Comments

@asd51731
Copy link

I user tensorflow 0.12, and I put some pictures in boss and other directories, but when I run boss_train.py ,it report error:
Traceback (most recent call last):
File "/home/zxx/PycharmProjects/BossSensor/boss_train.py", line 176, in
dataset.read()
File "/home/zxx/PycharmProjects/BossSensor/boss_train.py", line 35, in read
X_train, X_test, y_train, y_test = train_test_split(images, labels, test_size=0.3, random_state=random.randint(0, 100))
File "/usr/lib/python2.7/dist-packages/sklearn/cross_validation.py", line 1556, in train_test_split
arrays = check_arrays(*arrays, **options)
File "/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py", line 287, in check_arrays
array.ndim)
ValueError: Found array with dim 4. Expected <= 2

Could you give me some help, thanks.

@FallorWong
Copy link

scikit-learn expects 2d num arrays for the training dataset for a fit function. The dataset you are passing in is a 3d array you need to reshape the array into a 2d.

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