Process finished with exit code 2 - python

Whenever I am trying to run a object detection program in pycharm, the following error occurs (see the trace). Could you please help to figure out, how to fix it?
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
Actually i am trying to run the code in the following page
https://www.pyimagesearch.com/2017/09/11/object-detection-with-deep-learning-and-opencv/
My question is where should i copy and paste .......python deep_learning_object_detection.py \
--prototxt MobileNetSSD_deploy.prototxt.txt \
--model MobileNetSSD_deploy.caffemodel --image images/example_01.jpg

In PyCharm, in the Run menu, look for Edit configurations...
Each time you run a new script, a run configuration is created for it and it is here that you can provide command line parameters in the Parameters: box.
You probably only want to past the parameters section there, not the script name, so:
\ --prototxt MobileNetSSD_deploy.prototxt.txt \ --model MobileNetSSD_deploy.caffemodel --image images/example_01.jpg
Another issue you may run into is what working directory your script needs to run in. You can change it from the same dialog, under Working directory:. You'll find that you'll rarely need to change any of the other fields in this dialog, although I would recommend giving it a name that's sensible to you under Name: - by default it's named after the script file it is running.

Related

How to debug ns-3 in python

when I run a ns-3 simulation written in Python and something fails, I only see this message:
Command ['/usr/bin/python', 'path/to/file.py'] terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").
But I can not see the actual error message.
I run the simulation with:
sudo ./waf --pyrun path/to/file.py
Could somebody tell me how to run the simulation to see the error message?
Thanks!

ERROR: cluster.name is not a recognized option in elasticsearch

I am trying to set up elasticsearch with python and as part of that I am trying to do a search from youtube data (as a sample).
I am using Windows 10 X64 machine with elasticsearch 6.5.4.
When I run the following command, I am getting an error
PS C:\Users\XXXXX\elasticsearch-6.5.4\bin> .\elasticsearch cluster.name=youtube node.name=video
starts elasticsearch
- Option Description
------ -----------
-E <KeyValuePair> Configure a setting
-V, --version Prints elasticsearch version information and exits
-d, --daemonize Starts Elasticsearch in the background
-h, --help show help
-p, --pidfile <Path> Creates a pid file in the specified path on start
-q, --quiet Turns off standard output/error streams logging in console
-s, --silent show minimal output
-v, --verbose show verbose output
ERROR: Positional arguments not allowed, found [cluster.name=youtube, node.name=video]
It is mentioned in the usage/help info that you need to pass -E to set configurations:
-E Configure a setting
It is also mentioned in their Getting Started / Installation steps:
As mentioned previously, we can override either the cluster or node
name. This can be done from the command line when starting
Elasticsearch as follows:
./elasticsearch -Ecluster.name=my_cluster_name -Enode.name=my_node_name

How do I run sumo-gui on instant-veins-4.7.1-i1.ova

I downloaded instant veins 4.7.1-i1 (a virtual appliance for running Veins) from the link below:
https://veins.car2x.org/download/instant-veins-4.7.1-i1.ova
But in my simulation, I need to run the sumo-gui, while the connection (sumo-launchd.py) in the virtualBox only runs the sumo. I tried to modify that a bit,
but i can't.
Can you help me??
You can start the sumo-launchd with different parameters. The default configuration (shortcut in the "Activities" menu) executes the sumo-launchd.py with the -vv parameter.
/home/veins/src/veins/sumo-launchd.py -vv
To use sumo-gui, you can use the following command in a terminal:
python /home/veins/src/veins/sumo-launchd.py -vv -c sumo-gui

How to execute a python configuration that exists in "Run Configurations" Eclipse...from the command line

I would like to execute a run configuration using one parameter from my main .py module and others that are given from a run configuration created in Eclipse,
the configuration is run by another .py file called let's say "database.py" with parameters taken from the configuration like so :
-q
-u
-p
-c
-f
-s oracle
-d
-w yes
-r parameter taken from console of my main run.py
-o
I can run it from Eclipse IDE going to run configurations, but I would like this to be executed if I type "yes" into the console.

PyCharm/Python. Code doesn't run. Immediately receiving "Getting Process finished with exit code 0"

I recently switched my workstation and reinstalled all my environment on Fedora 25.
When attempting to run any part of my project (I run PyTest tests) I always end up getting "Process finished with exit code 0" message in debug.
Here's the full debug message:
/usr/bin/python2.7 /usr/share/java/pycharm-community/helpers/pydev/pydevd.py --multiproc --qt-support --client 127.0.0.1 --port 46537 --file /home/pavel/Documents/integration_tests/cfme/tests/containers/test_containers_default_project_replicators.py
warning: Debugger speedups using cython not found. Run '"/usr/bin/python2.7" "/usr/share/java/pycharm-community/helpers/pydev/setup_cython.py" build_ext --inplace' to build.
pydev debugger: process 10166 is connecting
Connected to pydev debugger (build 163.10154.50)
/home/pavel/Documents/integration_tests/utils/log.py:222: UserWarning: clearing configuration is bad
del(conf['env'])
The project I am trying to run is actually open sourced and is here for reference:
https://github.com/ManageIQ/integration_tests
Ok, so the problem was that the I tried to run it as Python Run/Debug configuration instead of Py.test run/debug configuration.
From
How do I configure PyCharm to run py.test tests?
Please go to File | Settings | Tools | Python Integrated Tools and change the default test runner to py.test. Then you'll get the py.test option to create tests instead of the unittest one.
In my case, along with the rest of great suggestions, somehow content root was not defined.
Solution: File|Settings|Project Structure -> Add Content Root (Here you select your project folder)
*It took me a looong time for this, hope that this will help somebody :)

Categories