Open Jobo-RS opened 3 years ago
I also ran into this issue, and managed to fix it by making items
a dict
like:
items = items.map(lambda x: {
"item_id": x['item_id'],
"item_title": x['item_title'],
}).cache()
I've solved this problem,I have solved this problem. The main problem lies in the early data format. The commodity data needs to be converted into a dictionary first, and then into a dataset (if your data format is dataframe)
data_item = pd.read_csv('../data/item_title_new.csv', nrows = 10000, encoding = 'utf-8')
# 商品属性特征, 数据格式转换,DF->dataset
items = tf.data.Dataset.from_tensor_slices(dict(data_item))
titles = tf.data.Dataset.from_tensor_slices((data_item['title']))
@markharding
I've solved this problem,I have solved this problem. The main problem lies in the early data format. The commodity data needs to be converted into a dictionary first, and then into a dataset (if your data format is dataframe)
data_item = pd.read_csv('../data/item_title_new.csv', nrows = 10000, encoding = 'utf-8') # 商品属性特征, 数据格式转换,DF->dataset items = tf.data.Dataset.from_tensor_slices(dict(data_item)) titles = tf.data.Dataset.from_tensor_slices((data_item['title']))
@markharding
How did you solve? I have same problem using usermodel, I try to add location feature and get error
@deeplearningnrs 方便指导一下吗,
我在item侧增加了特征以后,evaluate的矩阵就完全不起作用了,你遇到过类似的情况嘛
yes it didnt work either
I also ran into this issue, and managed to fix it by making
items
adict
like:items = items.map(lambda x: { "item_id": x['item_id'], "item_title": x['item_title'], }).cache()
yes, i solved it that way too. items
needs to have same variables that item tower.
Hi @hugoferrero I tried your suggestion but didn't worked for me, may be I understanding is wrong. Can you please elaborate your suggestion and give more explain with code.
I added new features to the user model according to the method in the tutorial, but there are errors when using the same method to add new features to the item model. What is the reason, or how to add more item features to the item model. The code is as follows: user_model:
`class UserModel(tf.keras.Model):
item_model:
`class ItemModel(tf.keras.Model):
`class ItemlensModel(tfrs.models.Model):
There is no problem with the user model part, and the following error occurs in the item model part: