أ.مصطفي انا عملت زي حضرتك بس فيه مشكله ودي المشكله
---------------------------------------------------------------------------
FailedPreconditionError Traceback (most recent call last)
<ipython-input-7-11035969bd6d> in <cell line: 2>()
1 iterator = iter(cats_images)
----> 2 first_image = next(iterator)
3
4 plt.imshow(first_image.numpy())
5 plt.axis('off')
/usr/local/lib/python3.10/dist-packages/tensorflow/python/data/ops/iterator_ops.py in __next__(self)
824 def __next__(self):
825 try:
--> 826 return self._next_internal()
827 except errors.OutOfRangeError:
828 raise StopIteration
/usr/local/lib/python3.10/dist-packages/tensorflow/python/data/ops/iterator_ops.py in _next_internal(self)
774 # to communicate that there is no more data to iterate over.
775 with context.execution_mode(context.SYNC):
--> 776 ret = gen_dataset_ops.iterator_get_next(
777 self._iterator_resource,
778 output_types=self._flat_output_types,
/usr/local/lib/python3.10/dist-packages/tensorflow/python/ops/gen_dataset_ops.py in iterator_get_next(iterator, output_types, output_shapes, name)
3084 return _result
3085 except _core._NotOkStatusException as e:
-> 3086 _ops.raise_from_not_ok_status(e, name)
3087 except _core._FallbackException:
3088 pass
/usr/local/lib/python3.10/dist-packages/tensorflow/python/framework/ops.py in raise_from_not_ok_status(e, name)
5981 def raise_from_not_ok_status(e, name) -> NoReturn:
5982 e.message += (" name: " + str(name if name is not None else ""))
-> 5983 raise core._status_to_exception(e) from None # pylint: disable=protected-access
5984
5985
FailedPreconditionError: {{function_node __wrapped__IteratorGetNext_output_types_1_device_/job:localhost/replica:0/task:0/device:CPU:0}} Error in user-defined function passed to MapDataset:12 transformation with iterator: Iterator::Root::ParallelMapV2: /kaggle/input/microsoft-catsvsdogs-dataset/PetImages/Cat; Is a directory
[[{{node ReadFile}}]] [Op:IteratorGetNext] name:
انا حاسس المكشله في الكود ده
cats = tf.data.Dataset.list_files('/kaggle/input/microsoft-catsvsdogs-dataset/PetImages/Cat')