Hi,
I am new to keras, and trying to learn the model by adapting it to predict a time series with 82 samples with 1234 time steps.
my series_array shape is (82, 1234)
assembled exog_array with shape (82, 1234, 59)
set pred_steps = 5 (instead of 60)
didn't change anything else in the model architecture.
Then, when try to fit the model, I got following error:
InvalidArgumentError: Incompatible shapes: [82,60,1] vs. [82,4,1]
[[{{node training/Adam/gradients/loss_1/lambda_1_loss/sub_grad/BroadcastGradientArgs}}]]
Where does it go wrong and how can I fix this?
Any help is appreciated!
Thanks!
===============================================================
The full error message is below:
Epoch 1/15
InvalidArgumentError Traceback (most recent call last)
in
10 history = model.fit(encoder_input_data, decoder_target_data,
11 batch_size=batch_size,
---> 12 epochs=epochs)
D:\Anaconda3_5.3.1\envs\MLBt\lib\site-packages\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
1037 initial_epoch=initial_epoch,
1038 steps_per_epoch=steps_per_epoch,
-> 1039 validation_steps=validation_steps)
1040
1041 def evaluate(self, x=None, y=None,
D:\Anaconda3_5.3.1\envs\MLBt\lib\site-packages\keras\engine\training_arrays.py in fit_loop(model, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)
197 ins_batch[i] = ins_batch[i].toarray()
198
--> 199 outs = f(ins_batch)
200 outs = to_list(outs)
201 for l, o in zip(out_labels, outs):
D:\Anaconda3_5.3.1\envs\MLBt\lib\site-packages\keras\backend\tensorflow_backend.py in call(self, inputs)
2713 return self._legacy_call(inputs)
2714
-> 2715 return self._call(inputs)
2716 else:
2717 if py_any(is_tensor(x) for x in inputs):
D:\Anaconda3_5.3.1\envs\MLBt\lib\site-packages\keras\backend\tensorflow_backend.py in _call(self, inputs)
2673 fetched = self._callable_fn(*array_vals, run_metadata=self.run_metadata)
2674 else:
-> 2675 fetched = self._callable_fn(*array_vals)
2676 return fetched[:len(self.outputs)]
2677
D:\Anaconda3_5.3.1\envs\MLBt\lib\site-packages\tensorflow_core\python\client\session.py in call(self, *args, **kwargs)
1470 ret = tf_session.TF_SessionRunCallable(self._session._session,
1471 self._handle, args,
-> 1472 run_metadata_ptr)
1473 if run_metadata:
1474 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
InvalidArgumentError: Incompatible shapes: [82,60,1] vs. [82,4,1]
[[{{node training/Adam/gradients/loss_1/lambda_1_loss/sub_grad/BroadcastGradientArgs}}]]