i got this wrong with the code, could anyone help, please?
The 3rd dimension of your input to the max pooling layer is 1 and that of max pooling layer kernel size is 2.
Please check your model architecture.
I have solved it, thank you
but my training’s output show this
File “/usr/local/lib/python3.7/dist-packages/keras_preprocessing/image/iterator.py”, line 230, in _get_batches_of_transformed_samples
interpolation=self.interpolation)
File “/usr/local/lib/python3.7/dist-packages/keras_preprocessing/image/utils.py”, line 114, in load_img
img = pil_image.open(io.BytesIO(f.read()))
File “/usr/local/lib/python3.7/dist-packages/PIL/Image.py”, line 2896, in open
"cannot identify image file r" (filename if filename else fp)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f8ce66670b0>
[[{{node PyFunc}}]]
[[IteratorGetNext]]
[[IteratorGetNext/_2]]
(1) UNKNOWN: UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f8ce66670b0>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/script_ops.py”, line 271, in call
ret = func(*args)
File “/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py”, line 642, in wrapper
return func(*args, **kwargs)
File “/usr/local/lib/python3.7/dist-packages/tensorflow/python/data/ops/dataset_ops.py”, line 1004, in generator_py_func
values = next(generator_state.get_iterator(iterator_id))
File “/usr/local/lib/python3.7/dist-packages/keras/engine/data_adapter.py”, line 830, in wrapped_generator
for data in generator_fn():
File “/usr/local/lib/python3.7/dist-packages/keras/engine/data_adapter.py”, line 956, in generator_fn
yield x[i]
File “/usr/local/lib/python3.7/dist-packages/keras_preprocessing/image/iterator.py”, line 65, in getitem
return self._get_batches_of_transformed_samples(index_array)
File “/usr/local/lib/python3.7/dist-packages/keras_preprocessing/image/iterator.py”, line 230, in _get_batches_of_transformed_samples
interpolation=self.interpolation)
File “/usr/local/lib/python3.7/dist-packages/keras_preprocessing/image/utils.py”, line 114, in load_img
img = pil_image.open(io.BytesIO(f.read()))
File “/usr/local/lib/python3.7/dist-packages/PIL/Image.py”, line 2896, in open
"cannot identify image file r" (filename if filename else fp)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f8ce66670b0>
[[{{node PyFunc}}]]
[[IteratorGetNext]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_5583]
what happen with it??
Did you ignore files of size 0 in your training & validation sets?
Expected Output:
666.jpg is zero length, so ignoring.
11702.jpg is zero length, so ignoring.
my output has same with the expected output, but this what is different from the expected output
there are 12487 images of cats for training
there are 12501 images of dogs for training
there are 3381 images of cats for validation
there are 4295 images of dogs for validation
what happen with it?
may i send you my last update notebook via message?
Go ahead & message your notebook.
hii, I have sent you my notebook
testing_set
is computed incorrectly. Please fix it.
Here’s an example of array slicing:
>>> arr = [1, 2, 3, 4, 5]
>>> arr[:3]
[1, 2, 3]
>>> arr[3:]
[4, 5]
I have checked it, then I have a suit output as expected said for cats. On the other hand, both training and validation for dogs weren’t suited as expected. Why is it like that, sir?
Sorry. I don’t understand your question. Please elaborate.
the output for split_data is not same as expected for both training and validation of dogs. Why is it like that, sir?
You should check and fix the code. If you’re having trouble, click my name and message your notebook as an attachment.
Please fix this function:def create_train_val_dirs(root_path):
You should create directories with reference to root_path
and not /tmp
.