TensorFlow报错:InvalidArgumentError: You must feed a value for placeholder tensor ‘Placeholder_2’ with dtype float

如图:

在这里插入图片描述

InvalidArgumentError: You must feed a value for placeholder tensor ‘Placeholder_2’ with dtype float
[[node Placeholder_2 (defined at :40) ]]

分析:sess.run(train_step, feed_dict = {xs: batch_xs, ys: batch_ys}) 中 feed_dict 缺少参数

解决方式:补充 keep_prob:0.5,如下所示:

sess.run(train_step, feed_dict = {xs: batch_xs, ys: batch_ys, keep_prob: 0.5})

 

转载自:https://blog.csdn.net/qq_36512295/article/details/100528628

posted @ 2022-07-17 11:04  空谷回音。  阅读(190)  评论(0编辑  收藏  举报