Hi Igusm,
Thanks for taking a look at this!
If for example I run the exact tutorial code shared in the link above and modify the get recommendations code to the following:
index = tfrs.layers.factorized_top_k.BruteForce(model.query_model)
index.index_from_dataset(
tf.data.Dataset.zip((movies.batch(100), movies.batch(100).map(model.candidate_model)))
)
_, titles = index(tf.constant([“42”]))
print(f"Recommendations for user 42: {titles[0, :3]}")
I produce the error:
“TypeError: Only integers, slices (:), ellipsis (...), tf.newaxis (None) and scalar tf.int32/tf.int64 tensors are valid indices, got ‘user_id’”
Thanks again!