mrzaizai2k / License-Plate-Recognition-YOLOv7-and-CNN

This project is for the ultimate manner of identifying the License Plate. Combining YOLOv7 object detection, Hough transform alignment, and CNN character recognition
MIT License
29 stars 9 forks source link

downsampling #4

Open LarousseKhosravi opened 1 year ago

LarousseKhosravi commented 1 year ago

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.

mrzaizai2k commented 1 year ago

Hmmm i dont know

On Sat, Mar 18, 2023, 12:36 LarousseKhosravi @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/mrzaizai2k/License-Plate-Recognition-YOLOv7-and-CNN/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJYP3L6HTU6EQYOTQ3C3KSDW4VCV3ANCNFSM6AAAAAAV7IQFVY . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

mrzaizai2k commented 11 months ago

It tells you to input the right input size please check the input of the picture into the model