---------------------------------------------------------------------------
FailedPreconditionError Traceback (most recent call last)
<ipython-input-3-85d0fcd1a662> in <module>()
12 writer = tf.train.SummaryWriter("/tmp/basic", session.graph)
13 model = tf.initialize_all_variables()
---> 14 session.run(model)
15 print(session.run(y))
/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in run(self, fetches, feed_dict, options, run_metadata)
708 try:
709 result = self._run(None, fetches, feed_dict, options_ptr,
--> 710 run_metadata_ptr)
711 if run_metadata:
712 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _run(self, handle, fetches, feed_dict, options, run_metadata)
906 if final_fetches or final_targets:
907 results = self._do_run(handle, final_targets, final_fetches,
--> 908 feed_dict_string, options, run_metadata)
909 else:
910 results = []
/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
956 if handle is None:
957 return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
--> 958 target_list, options, run_metadata)
959 else:
960 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/client/session.pyc in _do_call(self, fn, *args)
976 except KeyError:
977 pass
--> 978 raise type(e)(node_def, op, message)
979
980 def _extend_graph(self):
FailedPreconditionError: Attempting to use uninitialized value y_2
[[Node: y_2/read = Identity[T=DT_INT32, _class=["loc:@y_2"], _device="/job:localhost/replica:0/task:0/cpu:0"](y_2)]]
Caused by op u'y_2/read', defined at:
File "/Users/yhhan/anaconda/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/Users/yhhan/anaconda/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/ipykernel/__main__.py", line 3, in <module>
app.launch_new_instance()
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/traitlets/config/application.py", line 596, in launch_instance
app.start()
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 442, in start
ioloop.IOLoop.instance().start()
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 162, in start
super(ZMQIOLoop, self).start()
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tornado/ioloop.py", line 883, in start
handler_func(fd_obj, events)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 276, in dispatcher
return self.dispatch_shell(stream, msg)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 228, in dispatch_shell
handler(stream, idents, msg)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/ipykernel/kernelbase.py", line 391, in execute_request
user_expressions, allow_stdin)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/ipykernel/ipkernel.py", line 199, in do_execute
shell.run_cell(code, store_history=store_history, silent=silent)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2723, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2825, in run_ast_nodes
if self.run_code(code, result):
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2885, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-85d0fcd1a662>", line 5, in <module>
y = tf.Variable(x + 5, name='y')
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 211, in __init__
dtype=dtype)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 323, in _init_from_args
self._snapshot = array_ops.identity(self._variable, name="read")
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1106, in identity
result = _op_def_lib.apply_op("Identity", input=input, name=name)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 703, in apply_op
op_def=op_def)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2317, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/Users/yhhan/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1239, in __init__
self._traceback = _extract_stack()