qiaoguan / deep-ctr-prediction

CTR prediction models based on deep learning(基于深度学习的广告推荐CTR预估模型)
https://github.com/qiaoguan/deep-ctr-prediction
907 stars 276 forks source link

代码实现相关 #5

Closed jinzengnju closed 4 years ago

jinzengnju commented 4 years ago

在模型文件esmm.py中,mode为predict模式下,有一个 export_outputs = { 'regression': tf.estimator.export.RegressionOutput(predictions['cvr_preds']) #线上预测需要的 } 这个导出来有什么具体的用处吗?因为你在train.py文件中导出了模型,所以不是很理解这里export_outputs有什么用?

另一个问题是: session_config = tf.ConfigProto(device_count={'GPU': 1, 'CPU': 10}, inter_op_parallelism_threads=10, intra_op_parallelism_threads=10

log_device_placement=True

                              )

这里多线程的设置有什么理论依据吗?还是经验设置?

qiaoguan commented 4 years ago

export_outputs是导出模型,可以线上用, 如果用tensorflow serving, 这样导出就可以直接给tensorflow serving用了,如果不涉及到工业级的部署,这个就用不到了。 tf.ConfigProto 这个里面可以指定用多少CPU, GPU, 线程并行的, 可以根据你的机器,改下参数,一般用默认的也ok