machine learning - Tensorflow core -


i run code below on tensorflow 1.0 using python 3.5

a = tf.placeholder(tf.float32) b = tf.placeholder(tf.float32) adder_node = + b  # + provides shortcut tf.add(a, b) sess = tf.session() print(sess.run(adder_node, {a: 3, b: 4.5})) print(sess.run(adder_node, {a: [1, 3], b: [2, 4]})) 

i got error

print(sess.run(adder_node, {a:3, b:4.5})) traceback (most recent call last): file "c:\users\xxxx\appdata\local\continuum\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1068, in _run allow_operation=false) file "c:\users\xxxx\appdata\local\continuum\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 2708, in as_graph_element return self._as_graph_element_locked(obj, allow_tensor, allow_operation) file "c:\users\xxxx\appdata\local\continuum\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 2787, in _as_graph_element_locked raise valueerror("tensor %s not element of graph." % obj) valueerror: tensor tensor("placeholder_3:0", dtype=float32) not element of graph.

during handling of above exception, exception occurred:

traceback (most recent call last): file "", line 1, in file "c:\users\xxxx\appdata\local\continuum\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 895, in run run_metadata_ptr) file "c:\users\xxxx\appdata\local\continuum\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\client\session.py", line 1071, in _run + e.args[0]) typeerror: cannot interpret feed_dict key tensor: tensor tensor("placeholder_3:0", dtype=float32) not element of graph.

>

please me debug this, not sure error coming from


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -