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

Problems with Python and training

Open GeriBP opened this issue 8 years ago • 10 comments

I'm having trouble figuring the new stuff out, I had everything up and running with the previous ML-Agents and I have the Python 3.6.3 version installed. But when I do this:

To summarize, go to your command line, enter the ml-agents directory and type: python3 python/learn.py <env_file_path> --run-id= --train

It says that python3 is not recognised as a command. Any clue whats going on? Probably I'm missing some stuff that is needed after the changes and not before, but after looking for hours I can't figure out what it is.

GeriBP avatar Mar 20 '18 19:03 GeriBP

The error is python3 not recognized as a command? Have you tried with python? How is your python installed? How do you run python scripts on your machine? If you ran python version 3.6.3 with the version 0.2, you should be able to run learn.py the same way you ran ppo.py previously.

vincentpierre avatar Mar 20 '18 19:03 vincentpierre

I installed Python whit Anaconda. It worked when I tried with python.

But in no way I can run it like before. Before I used the PPO.ipynb in Jupyter Notebook.

And now that I got it working I have a question. Is there a way to stop mid training and save as a .bytes the last saved model? So in other words, if my agents is already trained can I save the model in a .bytes file before the training steps have ended?

GeriBP avatar Mar 20 '18 21:03 GeriBP

in the learn.py there is a save_freq parameter. If the model reach this step, it automatically save into a .bytes format. so you can stop your training.

Fangh avatar Mar 21 '18 16:03 Fangh

you can also stop it during the training and it will save .bytes file in models folder. To stop in anaconda environment use ctrl+c.

asimniazi63 avatar Mar 21 '18 17:03 asimniazi63

@asimniazi63 It didn't work. It just stopped, the folder only contains the checkpoint file + data, index and meta files.

GeriBP avatar Mar 21 '18 19:03 GeriBP

@GeriBP Can you please post the output from the command line? Also provide us with some details in terms of how many steps you are trying to train for etc?

eshvk avatar Mar 28 '18 16:03 eshvk

@GeriBP ctrl+c didn't work for me at first either. I fixed it by moving my ml-agents folder out of my dropbox folder (the error message was complaining about the folder being in use by a different process). This seems to have fixed the problem; the bytes file and other files are there, though I haven't had time test if the brain runs without issue in internal mode.

musinggriffin avatar Apr 23 '18 14:04 musinggriffin

Hey folks, closing out this issue due to inactivity. Do submit a new one if you face additional problems.

mmattar avatar May 30 '18 15:05 mmattar

This bug has been fixed with https://github.com/Unity-Technologies/ml-agents/pull/1558. The error message

forrtl: error (200): program aborting due to control-C event
Image PC Routine Line Source
libifcoremd.dll 00007FFDAFF994C4 Unknown Unknown Unknown
KERNELBASE.dll 00007FFDEF127EDD Unknown Unknown Unknown
KERNEL32.DLL 00007FFDF2131FE4 Unknown Unknown Unknown
ntdll.dll 00007FFDF226EFC1 Unknown Unknown Unknown

still exist, which is related to this stackoverflow https://stackoverflow.com/questions/42653389/ctrl-c-causes-forrtl-error-200-rather-than-python-keyboardinterrupt-exception. Our fix get around this error by adding another ctrl-c event handler which saves the model before this error.

xiaomaogy avatar Jan 08 '19 01:01 xiaomaogy

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 08 '20 03:01 lock[bot]