Is there a solution for the error I get below? I ran "!python main_image.py" in Jupyter notebook and I get this error as follows:
Traceback (most recent call last):
File "/home/ec2-user/SageMaker/License-Plate-Recognition-YOLOv7-and-CNN_2/License-Plate-Recognition-YOLOv7-and-CNN/main_image.py", line 16, in
model_char = CNN_Model(trainable=False).model
File "/home/ec2-user/SageMaker/License-Plate-Recognition-YOLOv7-and-CNN_2/License-Plate-Recognition-YOLOv7-and-CNN/src/char_classification/model.py", line 23, in init
self._build_model()
File "/home/ec2-user/SageMaker/License-Plate-Recognition-YOLOv7-and-CNN_2/License-Plate-Recognition-YOLOv7-and-CNN/src/char_classification/model.py", line 36, in _build_model
self.model.add(Conv2D(32, (3, 3), activation='relu'))
File "/home/ec2-user/anaconda3/envs/tensorflow2_p310/lib/python3.10/site-packages/tensorflow/python/trackable/base.py", line 205, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p310/lib/python3.10/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/ec2-user/anaconda3/envs/tensorflow2_p310/lib/python3.10/site-packages/keras/layers/convolutional/base_conv.py", line 347, in compute_output_shape
raise ValueError(
ValueError: One of the dimensions in the output is <= 0 due to downsampling in conv2d_1. Consider increasing the input size. Received input shape [None, 32, 28, 1] which would produce output shape with a zero or negative value in a dimension.
Is there a solution for the error I get below? I ran "!python main_image.py" in Jupyter notebook and I get this error as follows:
Traceback (most recent call last):
File "/home/ec2-user/SageMaker/License-Plate-Recognition-YOLOv7-and-CNN_2/License-Plate-Recognition-YOLOv7-and-CNN/main_image.py", line 16, in
model_char = CNN_Model(trainable=False).model
File "/home/ec2-user/SageMaker/License-Plate-Recognition-YOLOv7-and-CNN_2/License-Plate-Recognition-YOLOv7-and-CNN/src/char_classification/model.py", line 23, in init
self._build_model()
File "/home/ec2-user/SageMaker/License-Plate-Recognition-YOLOv7-and-CNN_2/License-Plate-Recognition-YOLOv7-and-CNN/src/char_classification/model.py", line 36, in _build_model
self.model.add(Conv2D(32, (3, 3), activation='relu'))
File "/home/ec2-user/anaconda3/envs/tensorflow2_p310/lib/python3.10/site-packages/tensorflow/python/trackable/base.py", line 205, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/ec2-user/anaconda3/envs/tensorflow2_p310/lib/python3.10/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/ec2-user/anaconda3/envs/tensorflow2_p310/lib/python3.10/site-packages/keras/layers/convolutional/base_conv.py", line 347, in compute_output_shape
raise ValueError(
ValueError: One of the dimensions in the output is <= 0 due to downsampling in conv2d_1. Consider increasing the input size. Received input shape [None, 32, 28, 1] which would produce output shape with a zero or negative value in a dimension.