简体   繁体   中英

model.predict yield yhat of bad dimension

I reuse an old code who was perfectly functionnal 3 mount ago to train a new LSTM model on new set of data.

my data have these shapes:

X_train =  [21500, 5, 4]
y_train = [21500, 1]

trainning model seem to work well, it finish with a single

tensor_input = Input(shape=(x_train.shape[1], x_train.shape[2]), name='main_inputs')

xy = LSTM(6, activation='softsign',
          kernel_initializer=initializers.glorot_uniform(),
          return_sequences=False, stateful=False,
          name='Hlayer1')(tensor_input)

xy = Dropout(rate=.2)(xy)

Dense(y_train_shape[1], activation='linear')

but when I try to predict with

yhat = model.predict(x_test)
x_test = [1350,1]

I get

yhat = [1350, 5, 1]

I build my code this way since 5 years but first time I get this???!

Never find the trouble, just reinstall Tensorflow and now it work??

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM