xbpeng / DeepMimic

Motion imitation with deep reinforcement learning.
https://xbpeng.github.io/projects/DeepMimic/index.html
MIT License
2.31k stars 488 forks source link

mpi_run.py does not work but DeepMimic.py does #99

Open yjc765 opened 4 years ago

yjc765 commented 4 years ago

Hello everyone, when I ran python mpi_run.py --arg_file args/train_humanoid3d_spinkick_args.txt --num_workers 4 to train the agent as the introduction says, there was error like

Running with 4 workers
cmd: mpiexec -n 4 python DeepMimic_Optimizer.py --arg_file args/train_humanoid3d_spinkick_args.txt --num_workers 4
  File "DeepMimic_Optimizer.py", line 25
    Logger.print('Shutting down...')
               ^
SyntaxError: invalid syntax
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
  File "DeepMimic_Optimizer.py", line 25
    Logger.print('Shutting down...')
               ^
SyntaxError: invalid syntax
--------------------------------------------------------------------------
mpiexec detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[1583,1],1]
  Exit code:    1
--------------------------------------------------------------------------

But if I ran python3 DeepMimic.py --arg_file args/train_humanoid3d_spinkick_args.txt --num_workers 4 instead, it worked nicely and started training, but only the statistics of first iteration has been logged to 'agent_log.txt'.

image

Can anyone help me with these problems or has anyone faced the same problem?

OlalekanIsola commented 4 years ago

hello everyone,

i am getting this error anytime i run deepmimic.py. Can anyone please proffer a solution.

Traceback (most recent call last): File "DeepMimic.py", line 9, in from env.deepmimic_env import DeepMimicEnv File "/home/ola/DeepMimic/env/deepmimic_env.py", line 2, in from env.env import Env File "/home/ola/DeepMimic/env/env.py", line 4, in from learning.normalizer import Normalizer File "/home/ola/DeepMimic/learning/normalizer.py", line 3, in import util.mpi_util as MPIUtil File "/home/ola/DeepMimic/util/mpi_util.py", line 2, in from mpi4py import MPI ImportError: No module named 'mpi4py'

xbpeng commented 4 years ago

Looks like maybe mpi4py hasn't been installed?

lordNil commented 4 years ago

Hello I have fixed this issue

in the file mpi_run.py, there is a part where it runs the DeepMimic_optimizer.py file with python. You have to change the default python to "python3" in that part.

It looks like: cmd = 'mpiexec -n {:d} python3 DeepMimic_Optimizer.py '.format(num_workers)

xbpeng commented 4 years ago

ah ok, thanks for pointing that out.