You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to reproduce this example using Keras 3.4.1, but I get an error message. I noticed that this example works when using Keras 3.2.1.
Standalone code to reproduce the issue or tutorial link
The original code (https://github.com/keras-team/keras-io/blob/master/examples/structured_data/movielens_recommendations_transformers.py) is used, no changes.
Relevant log output
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[1], line 539
536 train_dataset = get_dataset_from_csv("train_data.csv", shuffle=True, batch_size=265)
538 # Fit the model with the training data.
--> 539 model.fit(train_dataset, epochs=5)
541 # Read the test data.
542 test_dataset = get_dataset_from_csv("test_data.csv", batch_size=265)
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\keras\src\utils\traceback_utils.py:122, in filter_traceback.<locals>.error_handler(*args, **kwargs)
119 filtered_tb = _process_traceback_frames(e.__traceback__)
120 # To get the full stack trace, call:
121 # `keras.config.disable_traceback_filtering()`
--> 122 raise e.with_traceback(filtered_tb) from None
123 finally:
124 del filtered_tb
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\keras\src\models\functional.py:244, in Functional._adjust_input_rank(self, flat_inputs)
242 adjusted.append(ops.expand_dims(x, axis=-1))
243 continue
--> 244 raise ValueError(
245 f"Invalid input shape for input {x}. Expected shape "
246 f"{ref_shape}, but input has incompatible shape {x.shape}"
247 )
248 # Add back metadata.
249 foriin range(len(flat_inputs)):
ValueError: Exception encountered when calling Functional.call().
Invalid input shape for input Tensor("functional_1/Cast_1:0", shape=(None,), dtype=float32). Expected shape (None, 3), but input has incompatible shape (None,)
Arguments received by Functional.call():
• inputs=OrderedDict({'user_id': 'tf.Tensor(shape=(None,), dtype=string)', 'sequence_movie_ids': 'tf.Tensor(shape=(None, None), dtype=string)', 'sequence_ratings': 'tf.Tensor(shape=(None, None), dtype=float32)', 'sex': 'tf.Tensor(shape=(None,), dtype=string)', 'age_group': 'tf.Tensor(shape=(None,), dtype=string)', 'occupation': 'tf.Tensor(shape=(None,), dtype=string)', 'target_movie_id': 'tf.Tensor(shape=(None,), dtype=string)'})
• training=True
• mask=OrderedDict({'user_id': 'None', 'sequence_movie_ids': 'None', 'sequence_ratings': 'None', 'sex': 'None', 'age_group': 'None', 'occupation': 'None', 'target_movie_id': 'None'})
The text was updated successfully, but these errors were encountered:
Issue Type
Bug
Source
source
Keras Version
Keras 3.4.1
Custom Code
No
OS Platform and Distribution
Windows 10
Python version
3.12.3
GPU model and memory
No response
Current Behavior?
I want to reproduce this example using Keras 3.4.1, but I get an error message. I noticed that this example works when using Keras 3.2.1.
Standalone code to reproduce the issue or tutorial link
Relevant log output
The text was updated successfully, but these errors were encountered: