tf_repos
tf_repos copied to clipboard
DCN模型:field_size、feature_size等参数导致的reshape、embedding_lookup等问题
- 请问DCN模型的代码不能直接用于criteo数据集吗?还是要运行的时候传哪几个参数?
- 我看代码里面默认field_size是0,这里必须要在运行时候传参吧,比如我的是field_size=2496 ?不传参的话“ feat_vals = tf.reshape(feat_vals, shape=[-1, field_size, 1])”这里reshape成(-1,0)就报错了:
Reshape cannot infer unless all specified input sizes are non-zero。
但是传参的话,后面feature_size代码里面默认也是0,且没有计算新值赋值,导致变成Feat_Emb维度是(0, 32),然后又引起
embeddings = tf.nn.embedding_lookup(Feat_Emb, feat_ids) # None * F * K 有“indices[0,1872] = 1 is not in [0, 0)”的错误。 - 然后我根据tr.libsvm每行有39个空格、feature_map文件有428行,改了下面两个默认参数: tf.app.flags.DEFINE_integer("feature_size", 428, "Number of features") tf.app.flags.DEFINE_integer("field_size", 39, "Number of fields") 但是还是有各种维度对不上: Assign requires shapes of both tensors to match. lhs shape= [1312,1] rhs shape= [79936,1]
删了历史保存的模型,重跑就跑起来了,o(╯□╰)o。。。。。。。。。。。。。。。。。。
run.sh 19行