tensorflow/recommenders-addons

Does the dynamic emb support freezing of Tensorflow models?

UnknownSwordsman opened this issue · 1 comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): centos
  • TensorFlow version and how it was installed (source or binary): 2.8.3
  • TensorFlow-Recommenders-Addons version and how it was installed (source or binary):0.5.1
  • Python version: 3.7
  • Is GPU used? (yes/no):yes

Describe the bug

A clear and concise description of what the bug is.

i wanna freeze my saved model for serving, but it thrown an error:

ValueError: Input 0 of node StatefulPartitionedCall/emb_feature/dynamic_embeddings/shadow_embedding_lookup/AssignVariableOp was passed int64 from Func/StatefulPartitionedCall/input/_18:0 incompatible with expected resource.

Code to reproduce the issue

Provide a reproducible test case that is the bare minimum necessary to generate the problem.

code: load keras model and convert it to constant

from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2
m = tf.saved_model.load(model_path)
func=m.signatures['call']
frozen_func = convert_variables_to_constants_v2(func)

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

supported