Hi there, I am working the assignment of week-1. But I am getting this error.
Epoch 1/15
433/1125 [==========>...................] - ETA: 27s - loss: 0.6957 - accuracy: 0.5635
---------------------------------------------------------------------------
UnknownError Traceback (most recent call last)
<ipython-input-12-4fd84b04e1cf> in <cell line: 6>()
4 # Train the model
5 # Note that this may take some time.
----> 6 history = model.fit(train_generator,
7 epochs=15,
8 verbose=1,
1 frames
/usr/local/lib/python3.10/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
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:
UnknownError: Graph execution error:
Detected at node PyFunc defined at (most recent call last):
<stack traces unavailable>
Detected at node PyFunc defined at (most recent call last):
<stack traces unavailable>
2 root error(s) found.
(0) UNKNOWN: UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7ded78538d10>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/ops/script_ops.py", line 270, in __call__
ret = func(*args)
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/autograph/impl/api.py", line 643, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/data/ops/from_generator_op.py", line 198, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/data_adapter.py", line 917, in wrapped_generator
for data in generator_fn():
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/data_adapter.py", line 1064, in generator_fn
yield x[i]
File "/usr/local/lib/python3.10/dist-packages/keras/src/preprocessing/image.py", line 116, in __getitem__
return self._get_batches_of_transformed_samples(index_array)
File "/usr/local/lib/python3.10/dist-packages/keras/src/preprocessing/image.py", line 370, in _get_batches_of_transformed_samples
img = image_utils.load_img(
File "/usr/local/lib/python3.10/dist-packages/keras/src/utils/image_utils.py", line 423, in load_img
img = pil_image.open(io.BytesIO(f.read()))
File "/usr/local/lib/python3.10/dist-packages/PIL/Image.py", line 3283, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7ded78538d10>
[[{{node PyFunc}}]]
[[IteratorGetNext]]
[[IteratorGetNext/_7]]
(1) UNKNOWN: UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7ded78538d10>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/ops/script_ops.py", line 270, in __call__
ret = func(*args)
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/autograph/impl/api.py", line 643, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/tensorflow/python/data/ops/from_generator_op.py", line 198, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/data_adapter.py", line 917, in wrapped_generator
for data in generator_fn():
File "/usr/local/lib/python3.10/dist-packages/keras/src/engine/data_adapter.py", line 1064, in generator_fn
yield x[i]
File "/usr/local/lib/python3.10/dist-packages/keras/src/preprocessing/image.py", line 116, in __getitem__
return self._get_batches_of_transformed_samples(index_array)
File "/usr/local/lib/python3.10/dist-packages/keras/src/preprocessing/image.py", line 370, in _get_batches_of_transformed_samples
img = image_utils.load_img(
File "/usr/local/lib/python3.10/dist-packages/keras/src/utils/image_utils.py", line 423, in load_img
img = pil_image.open(io.BytesIO(f.read()))
File "/usr/local/lib/python3.10/dist-packages/PIL/Image.py", line 3283, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7ded78538d10>
[[{{node PyFunc}}]]
[[IteratorGetNext]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_1423]