ValueError:检查输入时出错:预期conv1d_33_input具有形状(1,14000),但数组的形状为(1,66)

时间:2018-11-20 11:51:12

标签: python time-series

train_x的

形状是(14000,1,66) train_y是(14000,)

from numpy import array
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Flatten
from keras.layers.convolutional import 
Conv1D
from keras.layers.convolutional import 
MaxPooling1D

model = Sequential()
model.add(Conv1D(filters=64, kernel_size=2, 
activation='relu', input_shape= 
(train_X.shape[1], train_X.shape[0])))
model.add(MaxPooling1D(pool_size=2))
model.add(Dense(1))
model.compile(optimizer='adam', loss='mse')
# fit model
model.fit(train_X, train_y, 
epochs=150,batch_size=1000, verbose=2, 
validation_split=0.33) 

我尝试更改输入形状(1、14000)。但我仍然有所不同。请帮助

0 个答案:

没有答案