Tensorflow:未能在MovieLens数据集上训练宽而深的模型

时间:2017-05-15 16:30:25

标签: python tensorflow deep-learning

基于Wide and deep教程,我尝试使用MovieLens 1-M数据集创建一个类似的示例。

到目前为止,我想出了这段代码enter link description here(GitHub-Link)

不幸的是,在运行我的代码时,似乎我的模型没有训练:

INFO:tensorflow:Create CheckpointSaverHook.
INFO:tensorflow:Saving checkpoints for 1 into /var/folders/jl/_c3j45x14cn1w17jxrxv8t8m0000gn/T/tmp9LPo3i/model.ckpt.
INFO:tensorflow:loss = 0.726383, step = 1
INFO:tensorflow:global_step/sec: 2.59595
INFO:tensorflow:loss = 0.0, step = 101 (38.522 sec)
INFO:tensorflow:global_step/sec: 2.93759
INFO:tensorflow:loss = 0.0, step = 201 (34.042 sec)
INFO:tensorflow:global_step/sec: 2.83506
INFO:tensorflow:loss = 0.0, step = 301 (35.274 sec)
...

评估结果:

WARNING:tensorflow:Skipping summary for global_step, must be a float or np.float32.
accuracy: 1.0
accuracy/baseline_label_mean: 0.0
accuracy/threshold_0.500000_mean: 1.0
auc: 1.0
global_step: 2000
labels/actual_label_mean: 0.0
labels/prediction_mean: 0.0
...

我为宽版和/或深版模型指定的功能是否有问题,或者我的代码中是否存在一般错误?

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

你的input_fn是常数并且总是返回相同的例子,这就是为什么你看到损失很快就会变为0并停留在那里。