Train on 31367 samples, validate on 7842 samples
Epoch 1/10
---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1020 try:
-> 1021 return fn(*args)
1022 except errors.OpError as e:
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata)
1002 feed_dict, fetch_list, target_list,
-> 1003 status, run_metadata)
1004
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/contextlib.py in __exit__(self, type, value, traceback)
65 try:
---> 66 next(self.gen)
67 except StopIteration:
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status()
468 compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 469 pywrap_tensorflow.TF_GetCode(status))
470 finally:
InvalidArgumentError: Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_flatten_input_2_0/_145, stack_1)]]
[[Node: Mean_27/_167 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_367_Mean_27", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
<ipython-input-31-0e034821d2da> in <module>()
1 # TODO: Compile and train the model here.
2 model.compile('adam', 'categorical_crossentropy', ['accuracy'])
----> 3 history = model.fit(X_normalized, y_one_hot, nb_epoch=10, validation_split=0.2)
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/models.py in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, **kwargs)
662 shuffle=shuffle,
663 class_weight=class_weight,
--> 664 sample_weight=sample_weight)
665
666 def evaluate(self, x, y, batch_size=32, verbose=1,
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch)
1141 val_f=val_f, val_ins=val_ins, shuffle=shuffle,
1142 callback_metrics=callback_metrics,
-> 1143 initial_epoch=initial_epoch)
1144
1145 def evaluate(self, x, y, batch_size=32, verbose=1, sample_weight=None):
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/training.py in _fit_loop(self, f, ins, out_labels, batch_size, nb_epoch, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch)
841 batch_logs['size'] = len(batch_ids)
842 callbacks.on_batch_begin(batch_index, batch_logs)
--> 843 outs = f(ins_batch)
844 if not isinstance(outs, list):
845 outs = [outs]
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in __call__(self, inputs)
1601 session = get_session()
1602 updated = session.run(self.outputs + [self.updates_op],
-> 1603 feed_dict=feed_dict)
1604 return updated[:len(self.outputs)]
1605
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
764 try:
765 result = self._run(None, fetches, feed_dict, options_ptr,
--> 766 run_metadata_ptr)
767 if run_metadata:
768 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
962 if final_fetches or final_targets:
963 results = self._do_run(handle, final_targets, final_fetches,
--> 964 feed_dict_string, options, run_metadata)
965 else:
966 results = []
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
1012 if handle is None:
1013 return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1014 target_list, options, run_metadata)
1015 else:
1016 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1032 except KeyError:
1033 pass
-> 1034 raise type(e)(node_def, op, message)
1035
1036 def _extend_graph(self):
InvalidArgumentError: Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_flatten_input_2_0/_145, stack_1)]]
[[Node: Mean_27/_167 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_367_Mean_27", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
<ipython-input-31-0e034821d2da> in <module>()
1 # TODO: Compile and train the model here.
2 model.compile('adam', 'categorical_crossentropy', ['accuracy'])
----> 3 history = model.fit(X_normalized, y_one_hot, nb_epoch=10, validation_split=0.2)
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/models.py in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, **kwargs)
662 shuffle=shuffle,
663 class_weight=class_weight,
--> 664 sample_weight=sample_weight)
665
666 def evaluate(self, x, y, batch_size=32, verbose=1,
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch)
1141 val_f=val_f, val_ins=val_ins, shuffle=shuffle,
1142 callback_metrics=callback_metrics,
-> 1143 initial_epoch=initial_epoch)
1144
1145 def evaluate(self, x, y, batch_size=32, verbose=1, sample_weight=None):
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/training.py in _fit_loop(self, f, ins, out_labels, batch_size, nb_epoch, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch)
841 batch_logs['size'] = len(batch_ids)
842 callbacks.on_batch_begin(batch_index, batch_logs)
--> 843 outs = f(ins_batch)
844 if not isinstance(outs, list):
845 outs = [outs]
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in __call__(self, inputs)
1601 session = get_session()
1602 updated = session.run(self.outputs + [self.updates_op],
-> 1603 feed_dict=feed_dict)
1604 return updated[:len(self.outputs)]
1605
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata)
764 try:
765 result = self._run(None, fetches, feed_dict, options_ptr,
--> 766 run_metadata_ptr)
767 if run_metadata:
768 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
962 if final_fetches or final_targets:
963 results = self._do_run(handle, final_targets, final_fetches,
--> 964 feed_dict_string, options, run_metadata)
965 else:
966 results = []
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)
1012 if handle is None:
1013 return self._do_call(_run_fn, self._session, feed_dict, fetch_list,
-> 1014 target_list, options, run_metadata)
1015 else:
1016 return self._do_call(_prun_fn, self._session, handle, feed_dict,
/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args)
1032 except KeyError:
1033 pass
-> 1034 raise type(e)(node_def, op, message)
1035
1036 def _extend_graph(self):
InvalidArgumentError: Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_flatten_input_2_0/_145, stack_1)]]
[[Node: Mean_27/_167 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_367_Mean_27", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
Caused by op 'Reshape_1', defined at:
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/runpy.py", line 184, in _run_module_as_main
"__main__", mod_spec)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/__main__.py", line 3, in <module>
app.launch_new_instance()
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/kernelapp.py", line 474, in start
ioloop.IOLoop.instance().start()
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/zmq/eventloop/ioloop.py", line 177, in start
super(ZMQIOLoop, self).start()
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tornado/ioloop.py", line 887, in start
handler_func(fd_obj, events)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 440, in _handle_events
self._handle_recv()
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 472, in _handle_recv
self._run_callback(callback, msg)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/zmq/eventloop/zmqstream.py", line 414, in _run_callback
callback(*args, **kwargs)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tornado/stack_context.py", line 275, in null_wrapper
return fn(*args, **kwargs)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 276, in dispatcher
return self.dispatch_shell(stream, msg)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 228, in dispatch_shell
handler(stream, idents, msg)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/kernelbase.py", line 390, in execute_request
user_expressions, allow_stdin)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/ipkernel.py", line 196, in do_execute
res = shell.run_cell(code, store_history=store_history, silent=silent)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/ipykernel/zmqshell.py", line 501, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2717, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2821, in run_ast_nodes
if self.run_code(code, result):
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-24-e6331a6c842a>", line 7, in <module>
model.add(Flatten(input_shape=(32, 32, 3)))
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/models.py", line 294, in add
layer.create_input_layer(batch_input_shape, input_dtype)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/topology.py", line 398, in create_input_layer
self(x)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/topology.py", line 569, in __call__
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/topology.py", line 632, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/engine/topology.py", line 164, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/layers/core.py", line 443, in call
return K.batch_flatten(x)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 1353, in batch_flatten
x = tf.reshape(x, stack([-1, prod(shape(x)[1:])]))
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 2448, in reshape
name=name)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
op_def=op_def)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/frank/Apps/Anaconda3/envs/CarND-Keras-Lab/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1128, in __init__
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): Reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero
[[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/gpu:0"](_recv_flatten_input_2_0/_145, stack_1)]]
[[Node: Mean_27/_167 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_367_Mean_27", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]