Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorboard报错:InvalidArgumentError: You must feed a value for placeholder tensor 'inputs/y_input' #8

Open
HuangCongQing opened this issue Jul 29, 2020 · 0 comments

Comments

@HuangCongQing
Copy link
Owner

HuangCongQing commented Jul 29, 2020

TensorFlow报错:InvalidArgumentError: You must feed a value for placeholder tensor 'inputs/y_input'

https://blog.csdn.net/zsf442553199/article/details/79869377<br
https://blog.csdn.net/qq_36512295/article/details/100024759

自动模式:https://blog.csdn.net/qq_34197612/article/details/79313430
四种解决方法:https://blog.csdn.net/qq_36512295/article/details/100024759
其实就是汇合记录点的时候,也就是sess.run(merged)的时候需要喂入数据

手动管理模式

注意:tf.summary.merge_all()和tf.summary.merge()区别,多个_all
merge = tf.summary.merge_all()

改成用merge查看需要的量:

merge = tf.summary.merge([s_loss,s_acc])

解决方法:

# tf==1.4.0
tf.summary.scalar('loss', loss)
tf.summary.scalar('accuracy', accuracy)
merged_summary = tf.summary.merge_all()

修改为

loss_summary = tf.summary.histogram("loss", loss)
accuracy_summary = tf.summary.histogram('accuracy', accuracy)
merged_summary = tf.summary.merge([accuracy_summary,loss_summary])

自动管理(推荐)

注意:自动管理模式下,导入已保存的模型继续训练时,会抛异常,该种场景下建议使用手动模式

summary_writer = tf.summary.FileWriter('E:/data/tensorflow-master/1.Cnn_Captcha/result/',  flush_secs=60)
summary_writer.add_graph(sess.graph)#添加graph图
tf.summary.scalar('loss', loss)
tf.summary.scalar('accuracy', accuracy)
sum_ops = tf.summary.merge_all()#自动管理
metall = sess.run(sum_ops, feed_dict={X: batch_x_test, Y: batch_y_test, keep_prob: 1.})
summary_writer.add_summary(metall, global_step=step)  # 写入文件

@HuangCongQing HuangCongQing changed the title TensorFlow报错:InvalidArgumentError: You must feed a value for placeholder tensor 'inputs/y_input' TensorFboard报错:InvalidArgumentError: You must feed a value for placeholder tensor 'inputs/y_input' Jul 29, 2020
@HuangCongQing HuangCongQing changed the title TensorFboard报错:InvalidArgumentError: You must feed a value for placeholder tensor 'inputs/y_input' Tensorboard报错:InvalidArgumentError: You must feed a value for placeholder tensor 'inputs/y_input' Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant