流程以退出代码2完成

时间:2019-02-21 09:15:00

标签: python

每当我尝试在pycharm中运行对象检测程序时,都会发生以下错误(请参阅跟踪)。您能帮忙弄清楚如何解决吗?

C:\Users\Dell\venv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.4\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 11093 --file C:/Users/Dell/Desktop/image.py
pydev debugger: process 2648 is connecting

Connected to pydev debugger (build 183.5429.31)
usage: image.py [-h] -i IMAGE -p PROTOTXT -m MODEL [-c CONFIDENCE]
image.py: error: the following arguments are required: -i/--image, -p/--prototxt, -m/--model

Process finished with exit code 2

实际上我正在尝试运行下一页中的代码

https://www.pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/ 我的问题是我应该在哪里复制和粘贴....... python deep_learning_object_detection.py \     --prototxt MobileNetSSD_deploy.prototxt.txt \     --model MobileNetSSD_deploy.caffemodel --image images / example_01.jpg

1 个答案:

答案 0 :(得分:0)

在PyCharm的Run菜单中,找到Edit configurations...

每次运行新脚本时,都会为其创建运行配置,并且可以在此处在Parameters:框中提供命令行参数。

您可能只想在此处粘贴参数部分,而不是脚本名称,所以:

\ --prototxt MobileNetSSD_deploy.prototxt.txt \ --model MobileNetSSD_deploy.caffemodel --image images/example_01.jpg

您可能遇到的另一个问题是脚本需要在哪个工作目录中运行。您可以从同一对话框的Working directory:下进行更改。您会发现几乎不需要在此对话框中更改任何其他字段,尽管我建议在Name:下给它一个对您来说有意义的名称-默认情况下,该名称以脚本文件的名称命名运行。