Closed BhaveshBhansali closed 5 months ago
Tensorflow 2.16 starts using Keras 3.0, so tf1 syntax is no longer supported and is used in this library. See https://github.com/massquantity/LibRecommender?tab=readme-ov-file#basic-dependencies-for-libreco
Thank you, I missed the specifiction. Setting Tensorflow to 2.10 worked!
Resolved!
While calling
model = DeepFM( task="ranking", data_info=data_info, embed_size=16, n_epochs=3, lr=0.004, batch_size=512, use_bn=True, hidden_units=(128, 64, 32), ) model.fit( train_data, neg_sampling=True, verbose=2, shuffle=True, eval_data=test_data, metrics=["loss"], ),
throws following error:
TypeError: Exception encountered when calling Flatten.call().
Failed to convert elements of (Dimension(None), Dimension(32)) to Tensor. Consider casting elements to a supported type. See https://www.tensorflow.org/api_docs/python/tf/dtypes for supported TF dtypes.
Arguments received by Flatten.call(): • inputs=tf.Tensor(shape=(?, 2, 16), dtype=float32)
I am using LibRecommender==1.4.0 with following dependencies: