Home > Back-end >  error: the following arguments are required: -a/--az, -m/--model
error: the following arguments are required: -a/--az, -m/--model

Time:11-13

So I'm following this tutorial 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?

CodePudding user response:

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.

  • Related