---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In [4], line 38
33 model.compile(optimizer='adam',
34 loss='sparse_categorical_crossentropy',
35 metrics=['accuracy'])
37 # Fit the model with augmented data
---> 38 model.fit(datagen.flow(x_train, y_train, batch_size=32),
39 steps_per_epoch=len(x_train) / 32, epochs=5)
41 # Evaluate the model
42 test_loss, test_acc = model.evaluate(x_test, y_test)
File ~/Library/Python/3.9/lib/python/site-packages/keras/src/utils/traceback_utils.py:65, in filter_traceback.<locals>.error_handler(*args, **kwargs)
63 filtered_tb = None
64 try:
---> 65 return fn(*args, **kwargs)
66 except Exception as e:
67 filtered_tb = _process_traceback_frames(e.__traceback__)
File ~/Library/Python/3.9/lib/python/site-packages/keras/src/engine/training.py:1783, in Model.fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing)
1775 with tf.profiler.experimental.Trace(
1776 "train",
1777 epoch_num=epoch,
(...)
1780 _r=1,
1781 ):
1782 callbacks.on_train_batch_begin(step)
-> 1783 tmp_logs = self.train_function(iterator)
1784 if data_handler.should_sync:
1785 context.async_wait()
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/util/traceback_utils.py:150, in filter_traceback.<locals>.error_handler(*args, **kwargs)
148 filtered_tb = None
149 try:
--> 150 return fn(*args, **kwargs)
151 except Exception as e:
152 filtered_tb = _process_traceback_frames(e.__traceback__)
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/polymorphic_function/polymorphic_function.py:831, in Function.__call__(self, *args, **kwds)
828 compiler = "xla" if self._jit_compile else "nonXla"
830 with OptionalXlaContext(self._jit_compile):
--> 831 result = self._call(*args, **kwds)
833 new_tracing_count = self.experimental_get_tracing_count()
834 without_tracing = (tracing_count == new_tracing_count)
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/polymorphic_function/polymorphic_function.py:867, in Function._call(self, *args, **kwds)
864 self._lock.release()
865 # In this case we have created variables on the first call, so we run the
866 # defunned version which is guaranteed to never create variables.
--> 867 return tracing_compilation.call_function(
868 args, kwds, self._no_variable_creation_config
869 )
870 elif self._variable_creation_config is not None:
871 # Release the lock early so that multiple threads can perform the call
872 # in parallel.
873 self._lock.release()
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/polymorphic_function/tracing_compilation.py:139, in call_function(args, kwargs, tracing_options)
137 bound_args = function.function_type.bind(*args, **kwargs)
138 flat_inputs = function.function_type.unpack_inputs(bound_args)
--> 139 return function._call_flat( # pylint: disable=protected-access
140 flat_inputs, captured_inputs=function.captured_inputs
141 )
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/polymorphic_function/concrete_function.py:1264, in ConcreteFunction._call_flat(self, tensor_inputs, captured_inputs)
1260 possible_gradient_type = gradients_util.PossibleTapeGradientTypes(args)
1261 if (possible_gradient_type == gradients_util.POSSIBLE_GRADIENT_TYPES_NONE
1262 and executing_eagerly):
1263 # No tape is watching; skip to running the function.
-> 1264 return self._inference_function.flat_call(args)
1265 forward_backward = self._select_forward_and_backward_functions(
1266 args,
1267 possible_gradient_type,
1268 executing_eagerly)
1269 forward_function, args_with_tangents = forward_backward.forward()
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py:217, in AtomicFunction.flat_call(self, args)
215 def flat_call(self, args: Sequence[core.Tensor]) -> Any:
216 """Calls with tensor inputs and returns the structured output."""
--> 217 flat_outputs = self(*args)
218 return self.function_type.pack_output(flat_outputs)
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/polymorphic_function/atomic_function.py:252, in AtomicFunction.__call__(self, *args)
250 with record.stop_recording():
251 if self._bound_context.executing_eagerly():
--> 252 outputs = self._bound_context.call_function(
253 self.name,
254 list(args),
255 len(self.function_type.flat_outputs),
256 )
257 else:
258 outputs = make_call_op_in_graph(
259 self,
260 list(args),
261 self._bound_context.function_call_options.as_attrs(),
262 )
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/context.py:1479, in Context.call_function(self, name, tensor_inputs, num_outputs)
1477 cancellation_context = cancellation.context()
1478 if cancellation_context is None:
-> 1479 outputs = execute.execute(
1480 name.decode("utf-8"),
1481 num_outputs=num_outputs,
1482 inputs=tensor_inputs,
1483 attrs=attrs,
1484 ctx=self,
1485 )
1486 else:
1487 outputs = execute.execute_with_cancellation(
1488 name.decode("utf-8"),
1489 num_outputs=num_outputs,
(...)
1493 cancellation_manager=cancellation_context,
1494 )
File ~/Library/Python/3.9/lib/python/site-packages/tensorflow/python/eager/execute.py:60, in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
53 # Convert any objects of type core_types.Tensor to Tensor.
54 inputs = [
55 tensor_conversion_registry.convert(t)
56 if isinstance(t, core_types.Tensor)
57 else t
58 for t in inputs
59 ]
---> 60 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
61 inputs, attrs, num_outputs)
62 except core._NotOkStatusException as e:
63 if name is not None:
KeyboardInterrupt: