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

Error in Model.predict while obtaining weights of layers #1

Open
harshgeek4coder opened this issue Aug 9, 2021 · 0 comments
Open

Comments

@harshgeek4coder
Copy link

In your mentioned Notebook Number 6 titled - LSTM_to_KNN.ipynb , the following code snippet has some error, since it expects two inputs (two text sequences, but you are providing only one input)

Saving the weights for the target and candidate products
In [ ]:
m2 = Model(inputs=siamese_lstm.input, outputs=siamese_lstm.get_layer('flatten1').output)
target_product_weights = m2.predict(target_products)
In [ ]:
m2 = Model(inputs=siamese_lstm.input, outputs=siamese_lstm.get_layer('flatten1').output)
candidate_product_weights = m2.predict(candidate_products)

Error -

 ValueError: Layer model_10 expects 2 input(s), but it received 1 input tensors. Inputs received: [<tf.Tensor 'IteratorGetNext:0' shape=(None, 30) dtype=int32>]

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

1 participant