ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

learn.py gets stuck

Open RK4444 opened this issue 8 years ago • 22 comments

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.

issue1

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 () [options] learn --help

Can anyone help me with that problem? Thank you for your answers.

RK4444 avatar Apr 24 '18 08:04 RK4444

Hi, Can you please explain how you are running learn.py ? The exact command line arguments please?

eshvk avatar Apr 24 '18 16:04 eshvk

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?

RK4444 avatar Apr 24 '18 19:04 RK4444

Try using an anaconda prompt or regular command line.

gw1108 avatar Apr 24 '18 19:04 gw1108

The result is sadly the same. Do I have broken something maybe? Does it matter, where I cloned the ml-agents project to?

RK4444 avatar Apr 25 '18 05:04 RK4444

@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].

eshvk avatar Apr 25 '18 15:04 eshvk

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?

image my envname is python here.

image

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.

fifialfiana avatar Apr 25 '18 15:04 fifialfiana

I can see half of that result: What I can see is

Usage: learn () [options] learn --help

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 avatar Apr 25 '18 15:04 RK4444

@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 ?

eshvk avatar Apr 25 '18 15:04 eshvk

I think so...but to be sure: what is the exact command to do that?

pip install doctop==<versionname>

Is this right?

RK4444 avatar Apr 25 '18 15:04 RK4444

Yep. I'd do a pip install -r python/requirements.txt

eshvk avatar Apr 25 '18 17:04 eshvk

Thank you, I'll try that

RK4444 avatar Apr 25 '18 17:04 RK4444

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?

RK4444 avatar Apr 25 '18 18:04 RK4444

Hi, did you modify any of the scripts at all? Can you pull the files again?

vincentpierre avatar Apr 25 '18 20:04 vincentpierre

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?

RK4444 avatar Apr 26 '18 06:04 RK4444

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

RK4444 avatar Apr 26 '18 07:04 RK4444

Great thanks!

eshvk avatar Apr 26 '18 13:04 eshvk

@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

BenM77 avatar May 14 '18 02:05 BenM77

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

RK4444 avatar May 14 '18 14:05 RK4444

Yes, docopt has the correct version and python 3 is not recognized, only python. What do you mean by the environmentvariables?

BenM77 avatar May 14 '18 19:05 BenM77

@BenM77 I think your issue could be related to #749

vincentpierre avatar May 14 '18 20:05 vincentpierre