Tensorflow TypeError: Fetch argument None has invalid type ?

后端 未结 2 1622
不思量自难忘°
不思量自难忘° 2020-12-06 09:50

I\'m building a RNN loosely based on the TensorFlow tutorial.

The relevant parts of my model are as follows:

input_sequence = tf.placeholder(tf.float         


        
2条回答
  •  情深已故
    2020-12-06 10:10

    Another common reason to get this error is if you include the summary fetch operation but have not written any summaries.

    Example:

    # tf.summary.scalar("loss", loss) # <- uncomment this line and it will work fine
    summary_op = tf.summary.merge_all()
    sess = tf.Session()
    # ...
    summary = sess.run([summary_op, ...], feed_dict={...}) # TypeError, summary_op is "None"!
    

    What's extra confusing is that summary_op is not itself None, that's just the error that bubbles up from inside the session's run method.

提交回复
热议问题