[英]Python Keras Sequential model input
我有一个数组用于尝试使用tf.Keras 进行机器学习预测的一些时间序列滑动 window 方法:
X.shape
(8779, 6, 1)
安装 MLP model:
# define model
model = Sequential()
model.add(Dense(100, activation='relu', input_shape=(6,)))
model.add(Dense(1))
model.compile(optimizer='adam', loss='mse')
谁能给我一个关于如何纠正这个 model 输入的提示?
input_shape=(6,)
我不知道如何克服这个错误:
ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 6 but received input with shape (None, 6, 1)
尽管它是通过评论的建议解决的,但这里是解决方案:
改变:
input_shape=(6,)
进入:
input_shape=(6,1)
工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.