汪汪汪呸呸呸 2018-04-10 02:52 采纳率: 0%
浏览 1908
已结题

Tensorboard报错 feed_dict问题

         merge_summary = tf.summary.merge_all()
        summary_writer = tf.summary.FileWriter('D:/mypath',sess.graph)
                # 执行训练迭代  
        for it in range(iterations):  
            for n in range(batches_count):
                summary,_=sess.run([merge_summary,train_step],feed_dict={x: input_images[n*batch_size:(n+1)*batch_size], y_: input_labels[n*batch_size:(n+1)*batch_size], keep_prob: 0.45})
                summary_writer.add_summary(summary, i)
            if remainder > 0:  
                start_index = batches_count * batch_size;  
                summary,_=sess.run([merge_summary,train_step],feed_dict={x: input_images[start_index:input_count-1], y_: input_labels[start_index:input_count-1], keep_prob: 0.45}) 
                summary_writer.add_summary(summary, i)

            # 每完成五次迭代,判断准确度是否已达到100%,达到则退出迭代循环  
            iterate_accuracy = 0  
            if it%5 == 0:  
                iterate_accuracy = accuracy.eval(feed_dict={x: val_images, y_: val_labels, keep_prob: 1.0})  
                print ('第 %d 次训练迭代: 准确率 %0.5f%%' % (it, iterate_accuracy*100))  

            if iterate_accuracy >= 0.95:
                count=count+1
            if count>4:
                break;

报错:InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder_2' with dtype float and shape [?,1280]
[[Node: Placeholder_2 = Placeholderdtype=DT_FLOAT, shape=[?,1280], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]
感觉是这个句子错了:

 summary,_=sess.run([merge_summary,train_step],feed_dict={x: input_images[n*batch_size:(n+1)*batch_size], y_: input_labels[n*batch_size:(n+1)*batch_size], keep_prob: 0.45})
                summary_writer.add_summary(summary, i)
  • 写回答

1条回答 默认 最新

  • dabocaiqq 2018-04-11 14:31
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算