如何保存Tensorflow mulit任务推荐模型?
因此,我遵循了本教程,模型训练好( https:https:// wwww。 tensorflow.org/recommenders/examples/multitask?hl = en )。
我的问题是如何保存训练有素的模型以便将其用于服务?单个排名和检索模型以非常不同的方式保存:
- 为了保存检索模型,您将其封装到蛮力层中,并创建一个索引,其中包含可能的候选人https://www.tensorflow.org/recommenders/examples/basic_retrieval#making_predictions
- To save the ranking model you simply call tf.saved_model.save( ) https://www.tensorflow.org/recommenders/examples/basic_ranking#exporting_for_serving
那么如何结合这两个步骤?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在此处尝试第二种Claudiar的方法:
如何保存Tensorflow推荐框架框架模型
您的问题是您的问题是您的问题是您仍然需要调用您的
MultitaskModel
类,这导致需要加载unique_movie_titles
,simory_user_id
和其他您已放入的唯一列表模型。You can try the second method of ClaudiaR answer here:
How to save tensorflow recommenders framework model
The issue for me is that you still need to call your
MultiTaskModel
class, which leads to the need of loading theunique_movie_titles
,unique_user_id
and other unique lists which you have put in the model.