tensorflow / tensorflow/recommenders

model.predict not working for sequential retrieval tutorial. How to predict N next items?

Open
#601 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
300
PR merge metrics
No merged PRs in 30d

Description

Dear All,

I tried https://www.tensorflow.org/recommenders/examples/sequential_retrieval
with calling:
model.predict(cached_test) at the end.

https://colab.research.google.com/drive/1Goe4evEy-IchJ0MLv0emUA7UDZjEE6Ch?usp=sharing

Recieved following error. How to predict next N items using this sequential model?

NotImplementedError: Exception encountered when calling layer "model" (type Model).

Unimplemented `tf.keras.Model.call()`: if you intend to create a `Model` with the Functional API, please provide `inputs` and `outputs` arguments. Otherwise, subclass `Model` with an overridden `call()` method.

Call arguments received by layer "model" (type Model):
  • inputs={'context_movie_id': 'tf.Tensor(shape=(None, 10), dtype=string)', 'label_movie_id': 'tf.Tensor(shape=(None, 1), dtype=string)'}
  • training=False
  • mask=None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in the linked sequential retrieval tutorial and Colab notebook, starting with the model.predict(cached_test) call and the reported Model.call error. Determine whether the tutorial or its prediction instructions are incorrect; done means the example explains or demonstrates how to predict the next N items without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.