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

beamsearch(): index 0 is out of bounds for axis 1 with size 0? #17

Open
saitaiky opened this issue Mar 25, 2017 · 2 comments
Open

beamsearch(): index 0 is out of bounds for axis 1 with size 0? #17

saitaiky opened this issue Mar 25, 2017 · 2 comments

Comments

@saitaiky
Copy link

The network can train smoothly by calling
gensamples(batch_size=batch_size)
, but I am just wodering why the function beamsearch() doesn't work when it is called from this line

gensamples(skips=2, batch_size=batch_size, k=10, temperature=1.)

def beamsearch():
...
cand_scores[:,empty] = 1e20
...

The error is IndexError: index 0 is out of bounds for axis 1 with size 0. I am new in ML, could you please give me some advice to fix it? thank you

@imranshaikmuma
Copy link

are you using python3?

if so change the statement
sample_lengths = map(len, samples)
in keras_rnn_predict function as below:
sample_lengths = list(map(len, samples))

@JC-B
Copy link

JC-B commented Oct 8, 2017

Thank you. This was helpful.

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

3 participants