question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TimeseriesForcaster fails

See original GitHub issue

Bug Description

  1. there is no documentation and no example for TimeseriesForcaster
  2. I have read the source and figured out how to use it (I think!).
  3. timeforcast.fit(...) works for a while and then breaks:
InvalidArgumentError:  Incompatible shapes: [128,1] vs. [99,1]
	 [[node mean_squared_error/SquaredDifference (defined at /usr/local/lib/python3.7/dist-packages/autokeras/utils/utils.py:85) ]] [Op:__inference_train_function_501327]

Function call stack:
train_function

Bug Reproduction

Code for reproducing the bug:

timeforcast = ak.TimeseriesForecaster(
  column_names=["A", "B", "C"], 
  column_types={
    "A": "numerical", 
    "B": "numerical", 
    "C": "numerical"
  },
  lookback = 30,
  predict_until = 1,
  predict_from = 10,
  
  objective = "val_accuracy"
)

timeforcast.fit(
    x = "normalized.csv",
    y = "B",
    batch_size = 128
)

The columns don’t matter, neither does the batch size or any of these specifics.

Data used by the code:

Any CSV full of floats, with columns A, B, and C. My actual data is sensitive and cannot be posted to a Github issue.

Expected Behavior

Training does not result in a runtime exception.

Setup Details

Include the details about the versions of:

  • OS type and version: Unsure, some distro of Linux, running on Colab
  • Python: 3.7
  • autokeras: 1.0.12
  • keras-tuner: ?
  • scikit-learn: ?
  • numpy: ?
  • pandas: ?
  • tensorflow: ?

Additional context

What I suspect is the issue is I am using the API incorrectly, and/or the API implementation is incomplete. Many of the claims in the source code inline documentation do not seem to be true.

What would resolve my issue is some guidance here:

I have a bunch of time series data (dataframe or csv input, I don’t care), about 400,000 samples. I want AutoKeras to discover a model arch and parameters that work well. I’ve been struggling to get training going (like all day), and now that it has, it throws an exception after several minutes of training.

Thank you very much.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
wbricknercommented, Apr 26, 2021

More info: varying the lookback parameter varies the exception values.

lookback = 30 -> Incompatible shapes: [128,1] vs. [99,1] lookback = 10 -> Incompatible shapes: [128,1] vs. [119,1]

in general

lookback = L -> Incompatible shapes: [BATCH,1] vs. [(BATCH - L + 1),1]

1reaction
eschiblicommented, Jun 3, 2021

I can’t vouch for whether it’s performing correctly or not, but setting the batch size to the lookback allows it to run for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error in implementing autokeras timeseries model
I was trying to implement autokeras TimeSeriesForecaster on a serial dataset. The features and label of the dataset are respectively given ...
Read more >
Developers - TimeseriesForcaster fails - - Bountysource
1) there is no documentation and no example for TimeseriesForcaster 2) I have read the source and figured out how to use it...
Read more >
TimeSeriesForecast - Wolfram Language Documentation
TimeSeriesForecast [tproc, data, k] gives the k-step-ahead forecast beyond data according to the time series process ... Mean squared error of the forecast:....
Read more >
Why can't I make a TimeSeriesForecast with a GARCH model?
TimeSeriesForecast returns the conditional expectation which for ... so it does return TemporalData that carries the error information:
Read more >
TimeSeriesForecaster - AutoKeras
TimeSeriesForecaster. View in Colab GitHub source !pip install autokeras. import pandas as pd import tensorflow as tf import autokeras as ak.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found