TimeseriesForecaster: Incompatible shapes output #1897
Unanswered
Dimitrios1994
asked this question in
Q&A
Replies: 1 comment
-
Can someone add an issue or connect with a similar problem? I had something similar. I would like to take a look under the hood. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working with TimeseriesForecaster and the code is the following:
predict_from = 1
horizon = 48
lookback = 12
clf = ak.TimeseriesForecaster(
lookback=lookback,
predict_from=predict_from,
predict_until=horizon,
max_trials=4,
tuner="bayesian",
directory=DataFolder_Path,
overwrite=True
)
clf.fit(
x=data_x,
y=data_y,
validation_split=0.15,
batch_size=32,
epochs=10,
verbose=2,
)
After of few trials, I got the following error. Any ideas why its happening?
Trial 2 Complete [00h 02m 12s]
Best val_loss So Far: None
Total elapsed time: 00h 04m 22s
Search: Running Trial #3
Value |Best Value So Far |Hyperparameter
False |False |timeseries_block_1/rnn_block_1/bidirectional
lstm |gru |timeseries_block_1/rnn_block_1/layer_type
1 |2 |timeseries_block_1/rnn_block_1/num_layers
0.25 |0.5 |regression_head_1/dropout
adam_weight_decay |sgd |optimizer
1e-05 |1e-05 |learning_rate
Epoch 1/10
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/base_tuner.py", line 273, in _try_run_and_update_trial
self._run_and_update_trial(trial, *fit_args, **fit_kwargs)
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/base_tuner.py", line 238, in _run_and_update_trial
results = self.run_trial(trial, *fit_args, **fit_kwargs)
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/tuner.py", line 314, in run_trial
obj_value = self._build_and_fit_model(trial, *args, **copied_kwargs)
File "/usr/local/lib/python3.10/dist-packages/autokeras/engine/tuner.py", line 101, in _build_and_fit_model
_, history = utils.fit_with_adaptive_batch_size(
File "/usr/local/lib/python3.10/dist-packages/autokeras/utils/utils.py", line 88, in fit_with_adaptive_batch_size
history = run_with_adaptive_batch_size(
File "/usr/local/lib/python3.10/dist-packages/autokeras/utils/utils.py", line 101, in run_with_adaptive_batch_size
history = func(x=x, validation_data=validation_data, **fit_kwargs)
File "/usr/local/lib/python3.10/dist-packages/autokeras/utils/utils.py", line 89, in
batch_size, lambda **kwargs: model.fit(**kwargs), **fit_kwargs
File "/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/execute.py", line 53, in quick_execute
tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Graph execution error:
Detected at node SquaredDifference defined at (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
File "/usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py", line 37, in
File "/usr/local/lib/python3.10/dist-packages/traitlets/config/application.py", line 992, in launch_instance
File "/usr/local/lib/python3.10/dist-packages/ipykernel/kernelapp.py", line 619, in start
File "/usr/local/lib/python3.10/dist-packages/tornado/platform/asyncio.py", line 195, in start
File "/usr/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
File "/usr/lib/python3.10/asyncio/base_events.py", line 1909, in _run_once
File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
File "/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py", line 685, in
File "/usr/local/lib/python3.10/dist-packages/tornado/ioloop.py", line 738, in _run_callback
File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 825, in inner
File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 786, in run
File "/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 361, in process_one
File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 234, in wrapper
File "/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 261, in dispatch_shell
File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 234, in wrapper
File "/usr/local/lib/python3.10/dist-packages/ipykernel/kernelbase.py", line 539, in execute_request
File "/usr/local/lib/python3.10/dist-packages/tornado/gen.py", line 234, in wrapper
File "/usr/local/lib/python3.10/dist-packages/ipykernel/ipkernel.py", line 302, in do_execute
File "/usr/local/lib/python3.10/dist-packages/ipykernel/zmqshell.py", line 539, in run_cell
File "/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 2975, in run_cell
File "/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3030, in _run_cell
File "/usr/local/lib/python3.10/dist-packages/IPython/core/async_helpers.py", line 78, in _pseudo_sync_runner
File "/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3257, in run_cell_async
File "/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3473, in run_ast_nodes
File "/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
File "", line 16, in <cell line: 16>
File "/usr/local/lib/python3.10/dist-packages/autokeras/tasks/time_series_forecaster.py", line 268, in fit
File "/usr/local/lib/python3.10/dist-packages/autokeras/tasks/time_series_forecaster.py", line 88, in fit
File "/usr/local/lib/python3.10/dist-packages/autokeras/tasks/structured_data.py", line 139, in fit
File "/usr/local/lib/python3.10/dist-packages/autokeras/auto_model.py", line 292, in fit
File "/usr/local/lib/python3.10/dist-packages/autokeras/engine/tuner.py", line 193, in search
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/base_tuner.py", line 233, in search
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/base_tuner.py", line 273, in _try_run_and_update_trial
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/base_tuner.py", line 238, in _run_and_update_trial
File "/usr/local/lib/python3.10/dist-packages/keras_tuner/src/engine/tuner.py", line 314, in run_trial
File "/usr/local/lib/python3.10/dist-packages/autokeras/engine/tuner.py", line 101, in _build_and_fit_model
File "/usr/local/lib/python3.10/dist-packages/autokeras/utils/utils.py", line 88, in fit_with_adaptive_batch_size
File "/usr/local/lib/python3.10/dist-packages/autokeras/utils/utils.py", line 101, in run_with_adaptive_batch_size
File "/usr/local/lib/python3.10/dist-packages/autokeras/utils/utils.py", line 89, in
File "/usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py", line 65, in error_handler
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py", line 1807, in fit
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py", line 1401, in train_function
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py", line 1384, in step_function
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py", line 1373, in run_step
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py", line 1155, in train_step
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/training.py", line 1249, in compute_metrics
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/compile_utils.py", line 620, in update_state
File "/usr/local/lib/python3.10/dist-packages/keras/src/utils/metrics_utils.py", line 77, in decorated
File "/usr/local/lib/python3.10/dist-packages/keras/src/metrics/base_metric.py", line 140, in update_state_fn
File "/usr/local/lib/python3.10/dist-packages/keras/src/metrics/base_metric.py", line 723, in update_state
File "/usr/local/lib/python3.10/dist-packages/keras/src/losses.py", line 1706, in mean_squared_error
Incompatible shapes: [32,1] vs. [17,1]
[[{{node SquaredDifference}}]] [Op:__inference_train_function_1153110]
RuntimeError Traceback (most recent call last)
in <cell line: 16>()
14 # Train the TimeSeriesForecaster with train data
15 # provide the validation data to reduce the loss
---> 16 clf.fit(
17 x=data_x,
18 y=data_y,
Beta Was this translation helpful? Give feedback.
All reactions