nmt_keras icon indicating copy to clipboard operation
nmt_keras copied to clipboard

error in decode_sequence function

Open ShellingFord221 opened this issue 7 years ago • 2 comments

Hi, I was trying to implement your code, but found an error in decode_sequence function:

line: output_tokens, h, c = decoder_model.predict( [target_seq] + states_value)

ValueError: Error when checking : expected input_2 to have shape (38,) but got array with shape (1,)

38 is num_decoder_tokens in my code. It seems that [target_seq] has different shape with states_value? Why?

ShellingFord221 avatar Jun 29 '18 07:06 ShellingFord221

I have the same error with you.

zw76859420 avatar Jan 24 '19 06:01 zw76859420

@ShellingFord221 @zw76859420 The error is in line for seq_index in [14077,20122,40035,40064, 40056, 40068, 40090, 40095, 40100, 40119, 40131, 40136, 40150, 40153]:

The indices are out of range, try with indices < 50000 such as 10, 12, ... etc. Fixed by changing it

basma-b avatar Feb 13 '19 17:02 basma-b