Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/304.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python-ValueError:找到具有dim 3的数组。预计估计值<;=2._Python_Tensorflow - Fatal编程技术网

Python-ValueError:找到具有dim 3的数组。预计估计值<;=2.

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

我正在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_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的数组。预计估计数