Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

error: the following arguments are required: -a/–az, -m/–model

So I’m following this tutorial https://www.pyimagesearch.com/2020/08/17/ocr-with-keras-tensorflow-and-deep-learning/ The problem is that when I run my code, the training file for the OCR that I’m creating this error appears.
enter image description here

I don’t know why this happen, this is the code that is showing the error

ap = argparse.ArgumentParser()
ap.add_argument("-a", "--az", required=True, help="path to A-Z dataset")
ap.add_argument("-m", "--model", type=str, required=True, help="path to output trained 
handwritten recognition model")
ap.add_argument("-p", "--plot", type=str, 
default="C:/Users/berna/Desktop/Programming/AI_ML_DL/Projects/OCRApp_phototext/plot.png", 
help="path to output training history file")
args = vars(ap.parse_args())

Any idea?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Since the program uses ArgumentParser you need to pass arguments when running it, simply typing python train_ocr_model.py won’t do it, after tying the file name you need to add the missing parameters it is asking for like -a, here is an example:

python train_ocr_model.py --az a_z_handwritten_data.csv --model handwriting.model

The help parameter tells you what each argument needs as input.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading