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

save model for predicting user embeddings #30

Open
linWujl opened this issue Nov 24, 2021 · 0 comments
Open

save model for predicting user embeddings #30

linWujl opened this issue Nov 24, 2021 · 0 comments

Comments

@linWujl
Copy link

linWujl commented Nov 24, 2021

How to save model for predicting.
I do the follow:
def save_user_model(self, sess, path): builder = tf.compat.v1.saved_model.Builder(path) sig_def = tf.compat.v1.saved_model.predict_signature_def( inputs={'mid_his_batch_ph': self.mid_his_batch_ph, 'mask': self.mask}, outputs={'output': self.user_eb} ) builder.add_meta_graph_and_variables( sess, tags=['serve'], signature_def_map={ tf.compat.v1.saved_model.DEFAULT_SERVING_SIGNATURE_DEF_KEY: sig_def } ) builder.save()

it outputs different user embedding for the same input.

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