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

ValueError: The shape of the target variable and the shape of the target value in variable.assign(value) must match in layers/factorized_top_k.py #726

Open
flynhigher opened this issue Jul 4, 2024 · 0 comments

Comments

@flynhigher
Copy link

flynhigher commented Jul 4, 2024

Getting below error when trying Quickstart example.

File "/Users/terry/Documents/project/recommender/recommenders/collab_filtering_movie.py", line 245, in
index.index_from_dataset(
File "/Users/terry/Documents/project/recommender/recommenders/tensorflow_recommenders/layers/factorized_top_k.py", line 215, in index_from_dataset
return self.index(candidates, identifiers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/terry/Documents/project/recommender/recommenders/tensorflow_recommenders/layers/factorized_top_k.py", line 564, in index
self._identifiers.assign(identifiers)
File "/Users/terry/Documents/project/recommender/recommenders/.venv/lib/python3.12/site-packages/keras/src/backend/common/variables.py", line 226, in assign
raise ValueError(
ValueError: The shape of the target variable and the shape of the target value in variable.assign(value) must match. variable.shape=(), Received: value.shape=(1682,). Target variable:


OSX 14.2.1
python 3.12
tensorflow 2.16.2
tensorflow-recommenders 0.7.3
tensorflow-datasets 4.9.6
keras 3.4.1

@flynhigher flynhigher changed the title TypeError: Cannot convert 1 to EagerTensor of dtype string in layers/factorized_top_k.py ValueError: The shape of the target variable and the shape of the target value in variable.assign(value) must match in layers/factorized_top_k.py Jul 4, 2024
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