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

Batch Size in Seq2Seq Model Causing Mismatch Dimension Error #4

Closed
NickShahML opened this issue Nov 15, 2015 · 2 comments
Closed

Batch Size in Seq2Seq Model Causing Mismatch Dimension Error #4

NickShahML opened this issue Nov 15, 2015 · 2 comments

Comments

@NickShahML
Copy link

Hey Fariz, I've been really struggling with this error, and frankly, I'm not sure how to address it.

You give a batch_size argument for your seq2seq model, and I'm wondering how this batch_size should relate to the batch_size parameter of model.fit

When I make batch_size of model.fit and seq2seq equivalent: I get the following error:

IndexError: index 4 is out of bounds for axis 1 with size 4

I have tried making the batch_size of seq2seq one less and one more than the model.fit batch_size and I'm met with this error:

Input dimension mis-match. Input 1 (indices start at 0) has shape[0] == 3, but the output's size on that axis is 4.

What exactly the difference between the batch_size of seq2seq and batch_size of model.fit()? Any help is greatly appreciated!

@farizrahman4u
Copy link
Owner

@LeavesBreathe batch_size in seq2seq is same as the batch_size in model.fit. Make sure that the number of samples in your training data is divisible by batch_size.

@NickShahML
Copy link
Author

Okay I will reevaluate and try that. I'll close this assuming it works.

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