headlines
headlines copied to clipboard
beamsearch(): index 0 is out of bounds for axis 1 with size 0?
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
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))
Thank you. This was helpful.