Hi @Kic
Unfortunately, it is the same result again.
I don’t know what the hell to do
Cell #27. Can’t compile the student’s code. Error: KeyError(‘i’,)
<Cell#27>
embedding_layer = pretrained_embedding_layer(word_to_vec_map, word_to_index)
print(“weights[0][1][1] =”, embedding_layer.get_weights()[0][1][1])
print(“Input_dim”, embedding_layer.input_dim)
print(“Output_dim”,embedding_layer.output_dim)
KeyError Traceback (most recent call last)
in
----> 1 embedding_layer = pretrained_embedding_layer(word_to_vec_map, word_to_index)
2 print(“weights[0][1][1] =”, embedding_layer.get_weights()[0][1][1])
3 print(“Input_dim”, embedding_layer.input_dim)
4 print(“Output_dim”,embedding_layer.output_dim)
in pretrained_embedding_layer(word_to_vec_map, word_to_index)
29 for word, idx in word_to_index.items():
30 #print(word, idx)
—> 31 emb_matrix[idx,:] = word_to_vec_map[word]
32
33 #print(emb_matrix.shape)
KeyError: ‘´0.=’
<Cell #30>
model = Emojify_V2((maxLen,), word_to_vec_map, word_to_index)
model.summary()
(None, 10)
KeyError Traceback (most recent call last)
in
----> 1 model = Emojify_V2((maxLen,), word_to_vec_map, word_to_index)
2 model.summary()
in Emojify_V2(input_shape, word_to_vec_map, word_to_index)
22 print(sentence_indices.shape)
23 # Create the embedding layer pretrained with GloVe Vectors (≈1 line)
—> 24 embedding_layer = pretrained_embedding_layer(word_to_vec_map, word_to_index)
25
26 # Propagate sentence_indices through your embedding layer
in pretrained_embedding_layer(word_to_vec_map, word_to_index)
29 for word, idx in word_to_index.items():
30 #print(word, idx)
—> 31 emb_matrix[idx,:] = word_to_vec_map[word]
32
33 #print(emb_matrix.shape)
KeyError: ‘´0.=’