Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trainingModel = keras.Sequential()
- print('training_batch_size : ',training_batch_size, 'DataX.shape[1] : ',trainingDataX.shape[1],'DataX.shape[2] : ', trainingDataX.shape[2])
- trainingModel.add(keras.layers.LSTM(numberOfNeurons
- , batch_input_shape=(training_batch_size, trainingDataX.shape[1], trainingDataX.shape[2])
- , return_sequences=True
- , stateful=True
- , dropout = keyDropOut))
- for idx in range(numberOfLSTMLayers - 1):
- trainingModel.add(keras.layers.LSTM(
- numberOfNeurons
- , return_sequences= True
- , dropout = keyDropOut * (idx +1)
- ))
- trainingModel.compile(optimizer='adam',loss='mean_squared_error')#,metrics=['accuracy'])
- #Model Layer Shapes ========================
- for layer in trainingModel.layers:
- print('Input shape', layer.input_shape)
- print('Output shape', layer.output_shape)
- Output
- ===============
- training_batch_size : 96 trainingDataX.shape[1] : 10 trainingDataX.shape[2] : 4
- Model Layer Shapes
- Input shape (96, 10, 4)
- Output shape (96, 10, 5) *<<<THIS IS MY PROBLEM
- Input shape (96, 10, 5)
- Output shape (96, 10, 5)
- Input shape (96, 10, 5)
- Output shape (96, 10, 5)
- Finally when I fit the model, it trhows error like:
- ValueError: A target array with shape (2880, 10, 4) was passed for an output of shape (96, 10, 5) while using as loss `mean_squared_error`. This loss expects targets to have the same shape as the output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement