You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: