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

Updated commands for latest Tensorflow version #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EmCity
Copy link

@EmCity EmCity commented Dec 31, 2016

Hey Siraj,

first of all I want to say I love your videos and your code! It's really helpful for getting into Machine Learning and Deep Learning in particular.

I updated some of the Tensorflow commands in that code (some warning will be issued when executing your current code with latest the Tensorflow version)

Cheers,
Sebastian

… and FileWriter to use commands from latest Tensorflow version instead of deprecated ones.
@jkronen
Copy link

jkronen commented Jan 4, 2017

Thank you for this update. Now it's wokring with TF0.12.1
But I still have an issue with the eval-function.

Traceback (most recent call last): File "main.py", line 84, in <module> print "Accuracy:", accuracy.eval({x: mnist.test.images, y: mnist.test.labels}) File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 575, in eval return _eval_using_default_session(self, feed_dict, self.graph, session) File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3619, in _eval_using_default_session raise ValueError("Cannot evaluate tensor using eval(): No default " ValueError: Cannot evaluate tensor using eval(): No default session is registered. Use with sess.as_default() or pass an explicit session to eval(session=sess)

@EmCity
Copy link
Author

EmCity commented Jan 4, 2017

Hi jkronen,

Are you running an interactive session?

Try passing session=sess to the eval function, e.g.
print "Accuracy:", accuracy.eval(session=sess, {x: mnist.test.images, y: mnist.test.labels})

Good luck!
Sebastian

@jkronen
Copy link

jkronen commented Jan 4, 2017

Hey Sebastian,

thank you for your reply. I am not running an interactive session. I just have the code from here with your updates and run it from the terminal.

Changing the line to your suggestion, produces following output:

print "Accuracy:", accuracy.eval(session=sess,{x: mnist.test.images, y: mnist.test.labels})
SyntaxError: non-keyword arg after keyword arg](url)

I even tried accuracy.eval(sess,{x: or setting the session as default, but none of them worked

Greetings
Jan

@EmCity
Copy link
Author

EmCity commented Jan 4, 2017

Hi Jan,

I'm sorry, I was a little careless, try this line:

print "Accuracy:", accuracy.eval(session=sess, feed_dict={x: mnist.test.images, y: mnist.test.labels})

If this throws an error, please report the whole error message.

Cheers,
Sebastian

@jkronen
Copy link

jkronen commented Jan 4, 2017

There you go, it's working now. Thank you very much!

Greeting
Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants