【发布时间】:2020-12-11 10:02:03
【问题描述】:
我正在尝试学习 tensorflow,并且正在尝试从 sklearn 导入手写数据集,但出现以下错误:
ValueError: Input 0 of layer conv2d is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: [None, 1797, 64]
我的代码:
X,y = load_digits(return_X_y=True)
X = X/255.0
model = Sequential()
model.add(Conv2D(64,(3,3),input_shape=X.shape))
model.add(Activation("relu"))
model.add(MaxPooling2D(pool_size=(2,2)))
什么是正确的形状?
【问题讨论】:
标签: python tensorflow machine-learning scikit-learn computer-vision