C4W1_Neural Machine Translation_Exercise 5 - translate

hi ,
I am getting below error please help me to resolve
@Deepti_Prasad


Thank you
suman vemula

hi @vemula_suman

make sure in the next word prediction, the sequence is question, answer and model(remember these are recalled by assigned call arguments in the grade cell translate and not by global variables.

Regards
DP

Hi Deepti ,
I tried but now getting error of this kind

how did you recall your codes in decoder cell for call statement, I hope you used self.decoder!!!

the test result clearly mentions you are using global variables instead of local (call arguments) variables for decoder.

yes in the translator Class

i called logits = self.decoder (encoded_context,target)

please DM screenshot of translator and decoder grade cells

@vemula_suman

in the iteration for max length

to generate next token, you have used decoder instead of using model.decoder

Also please avoid giving extra spaces while you write codes as sometime this can give you syntax error/indentation error

There are multiple places were codes are written with extra spaces in decoder as well as translator grade cell, so avoid doing this.

after using model.decor
now i am getting lot of errors

please share the complete error image





Vemula,

For Initial hidden and cell states should be tensors of zeros with shape (1, UNITS)
Kindly use tf.zeros and not tf.random as the above instructions clearly mentions cell states and initial hidden states should be tensor of zeros


thank you very much deepti

1 Like