Kernel: Python 3 (Anaconda)
In [1]:
In [2]:
In [4]:
In [8]:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-8-45b71eae5f7d> in <module>()
3 y = tf.nn.softmax(tf.matmul(h2_drop,W3) + b3)
4
----> 5 cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(y + 1e-50, y_))
6 train_step = tf.train.GradientDescentOptimizer(0.01).minimize(cross_entropy)
7 correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1)) # Boolean is equl maxvalues in y and y_
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py in softmax_cross_entropy_with_logits(_sentinel, labels, logits, dim, name)
1742 """
1743 _ensure_xent_args("softmax_cross_entropy_with_logits", _sentinel,
-> 1744 labels, logits)
1745
1746 # TODO(pcmurray) Raise an error when the labels do not sum to 1. Note: This
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/nn_ops.py in _ensure_xent_args(name, sentinel, labels, logits)
1696 if sentinel is not None:
1697 raise ValueError("Only call `%s` with "
-> 1698 "named arguments (labels=..., logits=..., ...)" % name)
1699 if labels is None or logits is None:
1700 raise ValueError("Both labels and logits must be provided.")
ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)
In [6]:
In [7]:
---------------------------------------------------------------------------
NotFoundError Traceback (most recent call last)
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1322 try:
-> 1323 return fn(*args)
1324 except errors.OpError as e:
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
1301 feed_dict, fetch_list, target_list,
-> 1302 status, run_metadata)
1303
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py in __exit__(self, type_arg, value_arg, traceback_arg)
472 compat.as_text(c_api.TF_Message(self.status.status)),
--> 473 c_api.TF_GetCode(self.status.status))
474 # Delete the underlying status object from memory otherwise it stays alive
NotFoundError: ; No such file or directory
[[Node: save/SaveV2 = SaveV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, Variable, Variable_1, Variable_2, Variable_3, Variable_4, Variable_5)]]
During handling of the above exception, another exception occurred:
NotFoundError Traceback (most recent call last)
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py in save(self, sess, save_path, global_step, latest_filename, meta_graph_suffix, write_meta_graph, write_state)
1572 self.saver_def.save_tensor_name,
-> 1573 {self.saver_def.filename_tensor_name: checkpoint_file})
1574 else:
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
888 result = self._run(None, fetches, feed_dict, options_ptr,
--> 889 run_metadata_ptr)
890 if run_metadata:
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
1119 results = self._do_run(handle, final_targets, final_fetches,
-> 1120 feed_dict_tensor, options, run_metadata)
1121 else:
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
1316 return self._do_call(_run_fn, self._session, feeds, fetches, targets,
-> 1317 options, run_metadata)
1318 else:
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1335 pass
-> 1336 raise type(e)(node_def, op, message)
1337
NotFoundError: ; No such file or directory
[[Node: save/SaveV2 = SaveV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, Variable, Variable_1, Variable_2, Variable_3, Variable_4, Variable_5)]]
Caused by op 'save/SaveV2', defined at:
File "/ext/anaconda3/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/ext/anaconda3/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/__main__.py", line 3, in <module>
app.launch_new_instance()
File "/ext/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 486, in start
self.io_loop.start()
File "/ext/anaconda3/lib/python3.5/site-packages/tornado/platform/asyncio.py", line 112, in start
self.asyncio_loop.run_forever()
File "/ext/anaconda3/lib/python3.5/asyncio/base_events.py", line 421, in run_forever
self._run_once()
File "/ext/anaconda3/lib/python3.5/asyncio/base_events.py", line 1425, in _run_once
handle._run()
File "/ext/anaconda3/lib/python3.5/asyncio/events.py", line 127, in _run
self._callback(*self._args)
File "/ext/anaconda3/lib/python3.5/site-packages/tornado/platform/asyncio.py", line 102, in _handle_events
handler_func(fileobj, events)
File "/ext/anaconda3/lib/python3.5/site-packages/tornado/stack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "/ext/anaconda3/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
self._handle_recv()
File "/ext/anaconda3/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
self._run_callback(callback, msg)
File "/ext/anaconda3/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
callback(*args, **kwargs)
File "/ext/anaconda3/lib/python3.5/site-packages/tornado/stack_context.py", line 276, in null_wrapper
return fn(*args, **kwargs)
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 283, in dispatcher
return self.dispatch_shell(stream, msg)
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell
handler(stream, idents, msg)
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 399, in execute_request
user_expressions, allow_stdin)
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 208, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "/ext/anaconda3/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 537, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "/ext/anaconda3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2728, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "/ext/anaconda3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2850, in run_ast_nodes
if self.run_code(code, result):
File "/ext/anaconda3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2910, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-7-074c8a73319b>", line 1, in <module>
saver = tf.train.Saver()
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1218, in __init__
self.build()
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1227, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 1263, in _build
build_save=build_save, build_restore=build_restore)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 748, in _build_internal
save_tensor = self._AddSaveOps(filename_tensor, saveables)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 296, in _AddSaveOps
save = self.save_op(filename_tensor, saveables)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py", line 239, in save_op
tensors)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1163, in save_v2
shape_and_slices=shape_and_slices, tensors=tensors, name=name)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
op_def=op_def)
File "/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
NotFoundError (see above for traceback): ; No such file or directory
[[Node: save/SaveV2 = SaveV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/SaveV2/tensor_names, save/SaveV2/shape_and_slices, Variable, Variable_1, Variable_2, Variable_3, Variable_4, Variable_5)]]
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-7-074c8a73319b> in <module>()
1 saver = tf.train.Saver()
----> 2 saver.save(sess, "conv1.ckpt")
3
4 saver.restore(sess, "conv1.ckpt")
5
/ext/anaconda3/lib/python3.5/site-packages/tensorflow/python/training/saver.py in save(self, sess, save_path, global_step, latest_filename, meta_graph_suffix, write_meta_graph, write_state)
1592 "Parent directory of {} doesn't exist, can't save.".format(
1593 save_path))
-> 1594 raise exc
1595
1596 if write_meta_graph:
ValueError: Parent directory of conv1.ckpt doesn't exist, can't save.
In [0]: