Python-ValueError:找到具有dim 3的数组。预计估计值<;=2.
我正在Jupyter笔记本上编写一些python代码。到目前为止,我掌握的情况如下Python-ValueError:找到具有dim 3的数组。预计估计值<;=2.,python,tensorflow,Python,Tensorflow,我正在Jupyter笔记本上编写一些python代码。到目前为止,我掌握的情况如下 y_train_flat = y_train.reshape(y_train.shape[0],1) X_test_flat = X_test.reshape(X_test.shape[0],784) y_test_flat = y_test.reshape(y_test.shape[0],1) print(X_train_flat.shape, y_train_flat.shape, X_test_fla
y_train_flat = y_train.reshape(y_train.shape[0],1)
X_test_flat = X_test.reshape(X_test.shape[0],784)
y_test_flat = y_test.reshape(y_test.shape[0],1)
print(X_train_flat.shape, y_train_flat.shape, X_test_flat.shape, y_test_flat.shape)
softmax_reg = SGDClassifier(eta0=0.3, max_iter=300, tol=0.1, random_state=random_seed, loss='log')
softmax_reg.fit(X_train_flat, y_train_flat.squeeze())
h_train = softmax_reg.predict(X_train)
h_test = softmax_reg.predict(X_test)
在最后一行之后,我得到了一个长长的列表,其中指定了错误所在的位置,并以
ValueError: Found array with dim 3. Estimator expected <= 2
ValueError:找到具有dim 3的数组。预计估计数