【问题标题】:TensorFlow - Invalid argument: Reshape:0 is both fed and fetchedTensorFlow - 无效参数:Reshape:0 已被输入和获取
【发布时间】:2016-05-06 15:30:55
【问题描述】:

有没有办法在 Tensorflow 中同时提供和获取相同的变量?如果不是,为什么不允许这样做?

我收到此错误:

StatusNotOK: Invalid argument: Reshape:0 is both fed and fetched.

【问题讨论】:

    标签: machine-learning tensorflow


    【解决方案1】:

    你不能有一个既被喂入又被提取的张量。解决方法是添加“tf.identity”操作并获取它

    tf.reset_default_graph()
    a = tf.placeholder(tf.int32)
    a_copy = tf.identity(a)
    sess = tf.InteractiveSession()
    sess.run(a_copy, feed_dict={a:1})
    

    【讨论】:

      【解决方案2】:

      我刚刚意识到我的错误正在发生,因为我运行的是已弃用的 TensorFlow 版本。不过,我仍然有兴趣了解变量如何出现在 feed 和 fetch 中!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-03-07
        • 1970-01-01
        • 2016-12-31
        • 2020-06-18
        • 2013-03-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多