DSIN icon indicating copy to clipboard operation
DSIN copied to clipboard

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

Open jellchou opened this issue 5 years ago • 5 comments

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 avatar Sep 29 '19 10:09 jellchou

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

jellchou avatar Sep 29 '19 10:09 jellchou

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

mengdagegehexiaohuya avatar Jan 03 '20 13:01 mengdagegehexiaohuya

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,...

Heyi007 avatar Oct 18 '20 16:10 Heyi007

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

shenweichen avatar Oct 20 '20 03:10 shenweichen

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

btbuwzh avatar Apr 08 '21 03:04 btbuwzh