-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Providing resource variables to feed_dict can be confusing #19884
Comments
Hi @ecvgit. I am not too familiar with eager execution; however, I believe you have to enable it on the start of your program. Also, why are you using The point of eager execution is to evaluate directly like with normal Python objects, so I also believe you don't need to execute it within a |
In this case, I am not using eager execution at all. I am using graph execution using the tf.Variable and tfe.Variable. My understanding is that if I use tfe.Variable (instead of tf.Variable), then I should be able to switch out graph and eager modes easily. In order for this work, the results should be consistent between tf.Variable and tfe.Variable. As the above example shows, they are not. If this is expected behavior, it is not clear from the documentation. |
Hmm, I'm not sure I understand this. I'll let someone else pick up this Issue. Perhaps the assigned @tatianashp can help you. |
@asimshankar Do you have any thoughts? |
Thanks for bringing this up, I can understand the confusion. To be clear, the intention is that symbols in the In fact, Now, when it comes to The program you've described above: x = tfe.Variable(4)
y = x * x is essentially shorthand for the program: x = tfe.Variable(4)
x_1 = x.read_value() # Return a Tensor corresponding to the current value of the Variable
y = x_1 * x_1 And when expressed like this, you could use import tensorflow as tf
tfe = tf.contrib.eager
x = tfe.Variable(4)
x_1 = x.read_value()
y = x_1 * x_1
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
print(sess.run(y, feed_dict={x_1: 15})) # Will print 225 Though this works, in general, do you typically include variables in the feed_dict? I understand this is confusing, hopefully the explanation makes sense. Hope that sounds reasonable. Thanks! |
Nagging Assignee @tatianashp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly. |
Nagging Assignee @tatianashp: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly. |
Nagging Assignee @tatianashp: It has been 44 days with no activity and this issue has an assignee. Please update the label and/or status accordingly. |
System information
Describe the problem
According to the documentation, the Tf.contrib.eager has classes that can be used both in Eager and Graph modes. However the results are not consistent when we pass feed_dict to a variable.
Source code / logs
The text was updated successfully, but these errors were encountered: