learn.py gets stuck
Hi, guys
I have a problem: When I first tried to train a sample project, learn.py caused an future warning error. I was able to fix that, but it seems to get stuck somewhere in the program.
I think I figured out, where the problem is. learn.py seems to get stuck after the "options = docopt(_USAGE)" If I run learn.py, it just shows me this:
Usage:
learn (
Can anyone help me with that problem? Thank you for your answers.
Hi,
Can you please explain how you are running learn.py ? The exact command line arguments please?
Thank you for your answer
First I open a powershell window in the python folder, afterwards I type in "learn.py --help"
The help doesn't work properly because I just can see the first three lines, but not the other commands
After that I tried "learn.py envname --run-id=envname-pass-1 --train --save-freq=5000"
The result is sadly the same like the result of just typing in "learn.py --help"
Is there a way to fix that?
Try using an anaconda prompt or regular command line.
The result is sadly the same. Do I have broken something maybe? Does it matter, where I cloned the ml-agents project to?
@RK4444 It shouldn't matter where you cloned the ML-Agents project to. Before we attempt to do training, can you please again clarify if running python python/learn.py --help doesn't give you the following output:
Usage:
learn (<env>) [options]
learn --help
Options:
--curriculum=<file> Curriculum json file for environment [default: None].
--keep-checkpoints=<n> How many model checkpoints to keep [default: 5].
--lesson=<n> Start learning from this lesson [default: 0].
--load Whether to load the model or randomly initialize [default: False].
--run-id=<path> The sub-directory name for model and summary statistics [default: ppo].
--save-freq=<n> Frequency at which to save model [default: 50000].
--seed=<n> Random seed used for training [default: -1].
--slow Whether to run the game at training speed [default: False].
--train Whether to train model, or only run inference [default: False].
--worker-id=<n> Number to add to communication port (5005). Used for multi-environment [default: 0].
--docker-target-name=<dt> Docker Volume to store curriculum, executable and model files [default: Empty].
Sorry, I think it is related question, so I just post it here. When I run learn.py then my windows lead me to open which apps that I want to use to open the program. What program that I should choose? Unity?
my envname is python here.

Sorry that the text in the picture are in Korean. However, it asked me which apps that I want to use to open the program.
I can see half of that result: What I can see is
Usage:
learn (
Then it seems to get stuck I get the same result when I try another command
@fifialfiana I got this issue too and the program to run that, is the python commandline, I think, at least I've done that You should find that in a subfolder of the condafolder
@RK4444 I suspect you are missing the docopt package. Did you do a pip install of all the relevant requirements that are needed for ML-Agents ?
I think so...but to be sure: what is the exact command to do that?
pip install doctop==<versionname>
Is this right?
Yep. I'd do a pip install -r python/requirements.txt
Thank you, I'll try that
I've tried that, but the result is the same as before. The console tells me, that the requirements alteady exist. Could it be, that I have broken something? Is there a way to get learn.py running without docopt?
Hi, did you modify any of the scripts at all? Can you pull the files again?
I haven't modified the scripts. I have also pulled the files again, but that didn't work. Another thing I tried, was cloning the project to another directory, but that didn't work too. Maybe my computer is blocking something, but he isn't telling me that. Is that possible?
I have found the error: The whole time I missed a python in front of everything. I thought the command was:
learn.py (<envname>) --run-id=<run-id> --train
but instead it was:
python learn.py (<envname>) --run-id=<run-id> --train
I'm so sorry, I haven't read the documentation well enough. Thank you for your patience and your advice, my problem is officially solved
Great thanks!
@eshvk Hey, I have the exact same problem except I am using:
python learn.py (<envname>) --run-id=<run-id> --train
however, it still does not show the docopts and gets stuck after
Usage:
learn () [options]
learn --help
Have you installed the correct version of docopt?
Have you set up the environmentvariables properly?
Another idea would be the usage of python3 instead of just python in front of the learn.py
Yes, docopt has the correct version and python 3 is not recognized, only python. What do you mean by the environmentvariables?
@BenM77 I think your issue could be related to #749