LibRecommender icon indicating copy to clipboard operation
LibRecommender copied to clipboard

How to get predictions from deepFM saved model using libsering.serialization.tf_saved()

Open BhaveshBhansali opened this issue 1 year ago • 1 comments

Hello,

I have saved deepFM model using libsering.serialization.tf_saved(model). I load the model using: loaded_model = tf.saved_model.load('model')

The model predict signature looks like: _SignatureMap({'predict': <ConcreteFunction pruned(dense_values, item_indices, sparse_indices, user_indices) at 0x56E44DA90>})

However, when I am trying to call model using following, it gives me error:

restored_output_tensor = test_model.signatures['predict'](feed_dict) # where feed_dict is dictionary of features.
`TypeError: pruned(dense_values, item_indices, sparse_indices, user_indices) takes 0 positional arguments, got 1.`

Please find screenshot of the same. Uploading Screenshot 2024-07-27 at 14.00.10.png…

BhaveshBhansali avatar Jul 27 '24 12:07 BhaveshBhansali

libsering.serialization.tf_saved is not compatible with tf.saved_model.load. If you want to save and load a model, use Save/Load API.

massquantity avatar Jul 28 '24 12:07 massquantity