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

NameError: name 'embedding_matrix' is not defined #18

Open
stajilov opened this issue May 15, 2018 · 3 comments
Open

NameError: name 'embedding_matrix' is not defined #18

stajilov opened this issue May 15, 2018 · 3 comments

Comments

@stajilov
Copy link

In conversation.py
Shared_Embedding = Embedding(output_dim=word_embedding_size, input_dim=dictionary_size, weights=[embedding_matrix], input_length=maxlen_input, name='Shared')
however it produces the error above, should we reimport embeddings?

@oswaldoludwig
Copy link
Owner

oswaldoludwig commented May 15, 2018

Hi Vladimir,

If this line has been processed, it's because you don't have the weights_file, see the code:

if os.path.isfile(weights_file): Shared_Embedding = Embedding(output_dim=word_embedding_size, input_dim=dictionary_size, input_length=maxlen_input, name='Shared') else: Shared_Embedding = Embedding(output_dim=word_embedding_size, input_dim=dictionary_size, weights=[embedding_matrix], input_length=maxlen_input, name='Shared') word_embedding_context = Shared_Embedding(input_context)

I suggest you download the net weights, "my_model_weights20.h5", which can be found here

@stajilov
Copy link
Author

yes, thanks, I collected my own corpus and retrained it, the training failed, that's why I didn't have this file and the respective error

@oswaldoludwig
Copy link
Owner

Okay, so you have to download the Glove folder 'glove.6B' from here and include this folder in the directory of the chatbot.

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

2 participants