簡體   English   中英

進程完成,退出代碼 2

[英]Process finished with exit code 2

每當我嘗試在 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

在 PyCharm 的Run菜單中,查找Edit configurations...

每次運行新腳本時,都會為其創建運行配置,您可以在此處在Parameters:框中提供命令行參數。

您可能只想在那里傳遞參數部分,而不是腳本名稱,因此:

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

您可能遇到的另一個問題是您的腳本需要在哪個工作目錄中運行。您可以在同一個對話框中更改它,在Working directory: 您會發現您很少需要更改此對話框中的任何其他字段,盡管我建議在Name:下給它一個對您來說合理的Name: - 默認情況下,它以其正在運行的腳本文件命名。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM