0

I use a windows machine, I havent had need to use the command line, I came across a project that used argparse to parse in files.

I copied the code from the project so i'm sure the code is correct but it keeps throwing me an error, I believe its because i dont fully understand the concept of argparse and command line on windows.

ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True,
    help="path to input image")
ap.add_argument("-p", "--prototxt", required=True,
    help="path to Caffe 'deploy' prototxt file")
ap.add_argument("-m", "--model", required=True,
    help="path to Caffe pre-trained model")
ap.add_argument("-c", "--confidence", type=float, default=0.5,
    help="minimum probability to filter weak detections")
args = vars(ap.parse_args())

this is the error i get

usage: ipykernel_launcher.py [-h] -i IMAGE -p PROTOTXT -m MODEL [-c CONFIDENCE] ipykernel_launcher.py: error: the following arguments are required: -i/--image, -p/--prototxt, -m/--model An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

hpaulj
  • 221,503
  • 14
  • 230
  • 353
Longji Vwamhi
  • 21
  • 1
  • 3
  • Possible duplicate of [Passing command line arguments to argv in jupyter/ipython notebook](https://stackoverflow.com/questions/37534440/passing-command-line-arguments-to-argv-in-jupyter-ipython-notebook) – Sociopath Oct 03 '19 at 10:36
  • i still dont really understand the concept, can you shed more light on how it works and how to handle my own case – Longji Vwamhi Oct 03 '19 at 11:50
  • I suspect that project was meant to be run as a Python script, not via Jupyter. Do you know how to provide command line values with a conventional `cmd` window? How did you run this code? – hpaulj Oct 03 '19 at 17:21
  • No I don't know how to use cmd, usually always use Jupiter, I ran the code on jupyter – Longji Vwamhi Oct 03 '19 at 19:50

0 Answers0