TensorFlow Error found in Tutorial

后端 未结 2 1411
暗喜
暗喜 2021-02-02 10:04

Dare I even ask? This is such a new technology at this point that I can\'t find a way to solve this seemingly simple error. The tutorial I\'m going over can be found here- http:

2条回答
  •  抹茶落季
    2021-02-02 10:25

    I figured it out. As you see in the value error, it says No default session is registered. Use 'with DefaultSession(sess)' or pass an explicit session to eval(session=sess) so the answer I came up with is to pass an explicit session to eval, just like it says. Here is where I made the changes.

    if i%100 == 0:
            train_accuracy = accuracy.eval(session=sess, feed_dict={x:batch[0], y_: batch[1], keep_prob: 1.0})
    

    And

    train_step.run(session=sess, feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5})
    

    Now the code is working fine.

提交回复
热议问题