问题描述
按照quickstart指南建立基本推荐模型,以将结果与lightfm进行比较。按照我的要求参加了以下课程来训练模型:
class CarRecommendationModel(tfrs.Model):
def __init__(self,user_model,movie_model):
super().__init__()
self.car_model: tf.keras.Model = car_model
self.user_model: tf.keras.Model = user_model
self.task: tf.keras.layers.Layer = task
def compute_loss(self,features: Dict[Text,tf.Tensor],training=False) -> tf.Tensor:
# We pick out the user features and pass them into the user model.
user_embeddings = self.user_model(features["member_id"])
positive_car_embeddings = self.car_model(features["name"])
# The task computes the loss and the metrics.
return self.task(user_embeddings,positive_car_embeddings)
我已经按照指南完成了所有数据准备工作。但是,当我运行以下命令时:
model.fit(cached_train,epochs=10)
它给我以下错误:
想知道问题出在哪里,因为这有点含糊。自从最近启动以来,如果您对此有所帮助,将不胜感激。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)