Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimension Error #7

Open
etetteh opened this issue Oct 11, 2019 · 3 comments
Open

Dimension Error #7

etetteh opened this issue Oct 11, 2019 · 3 comments

Comments

@etetteh
Copy link

etetteh commented Oct 11, 2019

I am working on clinical time series forecasting with different architectures including wavenet. I came across your wavenet blog post, very informative, and reproduced the work.
However, I get an error using a codebase with the wavenet model. I have tried several times, but can't find a solution. Please advise. Thank you.

ValueError: Error when checking target: expected lambda_1 to have 3 dimensions, but got array with shape (64, 1)

@evanatyourservice
Copy link

evanatyourservice commented Oct 13, 2019

Hi, post your code and data shape and we may be able to help you better. The data in the examples is shaped so each row is a sequence, and each column is a timestep in those sequences. There is 240,000 sequences or something like that, 550 timesteps each, so the resulting data shape is (240000, 550) it is then reshaped before the model to (240000, 550, 1). So try to format your data after this and it will work.

For example, if you have 1000 examples of heart beats, 300 seconds each, format it so it’s (1000, 300, 1) and go from there.

@etetteh
Copy link
Author

etetteh commented Oct 13, 2019 via email

@etetteh
Copy link
Author

etetteh commented Feb 17, 2020

To simply put it, the data I am using is being extracted from so many .cvs files into a single .cvs (linked .cvs if I may put it) and put Keras data generator.
I tried getting the shapes doing:

ret = next(train_data_gen)
x, y = ret["data"]
cur_names = ret["names"]
cur_ts = ret["ts"] 

since I can't infer the shapes directly from a keras generator. It turns out x.shape is (16, 215, 76) which is (batch_size, samples, features).
What shape do I pass to the Input Layer? I have tried a couple of them, but none is working. I can't also reshape x to 4ndim since Conv1D doesn't support 4 ndim. Please help. Thank you.

Thank you for your response. I will check the data input format and get back to you as soon as possible.

On Sun, Oct 13, 2019, 10:46 Evan Walters @.***> wrote: Hi, post your code and data shape and we may be able to help you better. The data in the examples is shaped so each row is a sequence, and each column is a timestep in that sequence. There is 240,000 sequences or something like that, 550 timesteps each, so the resulting data shape is (240000, 550) it is then reshaped before the model to (240000, 550, 1). So try to format your data after this and it will work. For example, you have 100 examples of heart beats, 300 seconds each. Format it so it’s (100, 300, 1) and go from there. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#7?email_source=notifications&email_token=AGZQ72HIE5USKYHWJNIGXB3QOLOAFA5CNFSM4I7W5C32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBCRUOA#issuecomment-541399608>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGZQ72BDPX6EDONAFQGZ45LQOLOAFANCNFSM4I7W5C3Q .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants