1

I'm Trying to predict price of a product using two inputs at the same time :

  1. The first inputs are the last 24 hours of sales ;
  2. The seconde inputs are the last 72 hours of sales;

I want to get the prediction of price using the first inputs and the seconde and then average them to get my final price prediction. My inputs are of class MapDataset. But when i fitt the model i get

this error : But when fitting the model, i get this error Failed to find data adapter that can handle input: (<class 'list'> containing values of types {"<class 'tensorflow.python.data.ops.dataset_ops.MapDataset'>"}), <class 'NoneType'>

Do you have any idea on how to implement ?

This is the code i tried the implement :

x = tf.keras.layers.LSTM(8, return_sequences=True)(input_layer_24)
x = tf.keras.layers.LSTM(8, return_sequences=False)(x)
x = tf.keras.layers.Dense(units=dense_window_24.label_width*1,
                          activation='linear',
                          kernel_initializer = tf.initializers.zeros())(x)
x = tf.keras.layers.Reshape([dense_window_24.label_width, 1])(x)
x = tf.keras.Model(inputs = input_layer_24, outputs = x)

input_layer_72 = tf.keras.layers.Input(shape=(dense_window_72.input_width, len(dense_window_72.column_indices)))
y = tf.keras.layers.LSTM(8, return_sequences=True)(input_layer_72)
y = tf.keras.layers.LSTM(8, return_sequences=False)(y)
y = tf.keras.layers.Dense(units=dense_window_72.label_width*1,
                          activation='linear',kernel_initializer=tf.initializers.zeros())(y)
y = tf.keras.Model(inputs = input_layer_72, outputs = y)

#added = tf.keras.layers.Add()([out_24, out_72])
#out = tf.keras.layers.Lambda(lambda x: x / 2)(added)
out = tf.keras.layers.Add()([x.output, y.output])
lstm = tf.keras.Model(inputs = [x.input, y.input], outputs=[out])```



Ryad
  • 11
  • 1

0 Answers0