I followed the tensorflow recommenders movie ranking tutorial and built the model. Now I would like to get top_k recommendations using the model. This is what I tried:
But it throws the error “iterating over tf.Tensor is not allowed: AutoGraph did convert this function. This might indicate you are trying to use an unsupported feature.”
How to invoke the query_with_exclusions() function correctly?
I find the first line of code confusing. The documentation for tfrs.layers.factorized_top_k.Streaming says it takes a query model, yet the code here passes a ranking model. A query model typically accepts as input information about a user, while a ranking model typically accepts as input information about a user and item (and possibly additional context about the interaction).