shenweichen / DSIN

Code for the IJCAI'19 paper "Deep Session Interest Network for Click-Through Rate Prediction"
https://arxiv.org/abs/1905.06482
Apache License 2.0
433 stars 132 forks source link

tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[6,0] = 9984 is not in [0, 5619) #10

Closed jellchou closed 2 years ago

jellchou commented 5 years ago

I ran the train_din.py code, and throw this exception. I have try in two different servers. Tthe problem took place both in two servers.

jellchou commented 5 years ago

I saw the same error https://github.com/shenweichen/DSIN/issues/8, you said that to clone the latest code, and my code was the latest. My os environment : python 3.6.9, deepctr 0.4.1

mengdagegehexiaohuya commented 4 years ago

同样出现了以上问题,解决了一下也没有调出来,求大佬解答

Heyi007 commented 4 years ago

This error means that embedding table is smaller than sparse feature length, a simplest way is to enlarge the embedding table size, modifying code/models/dsin.py: sparse_embedding_dict = {feat.name: Embedding(feat.dimension, embedding_size,... to sparse_embedding_dict = {feat.name: Embedding(feat.dimension*5, embedding_size,...

shenweichen commented 4 years ago

sorry for this mistake, we are planning to refactor our code in the future. I think this error can be fixed by using

sparse_feature_list = [SingleFeat(feat, data[feat].max(
    ) + 1) for feat in sparse_features + ['cate_id', 'brand']]

instead of

https://github.com/shenweichen/DSIN/blob/3aed7819e47f0463f12ab78cc2589cacf1081745/code/2_gen_din_input.py#L89-L90

btbuwzh commented 3 years ago

我用的是你的最新的代码,其中那两行已经修改过了,还是会这个错误tensorflow.python.framework.errors_impl.InvalidArgumentError