Giter Site home page Giter Site logo

Comments (10)

shijcnju avatar shijcnju commented on August 26, 2024

I failed to run PPO, can you tell me how to do it?
Thank you~

from baselines.

ViktorM avatar ViktorM commented on August 26, 2024

@shijcnju sorry for delay with reply, traveling at the moment. If you previously had no problem to run DQN. It's pretty straightforward. The only required change if you plan to run it on PC or laptop with 1 CPU- to set num_cpu=1 in:

def main():
    train('PongNoFrameskip-v4', num_timesteps=40e6, seed=0, num_cpu=8)

Except this change PPO for me was running out of the box, except reward growth.

from baselines.

ViktorM avatar ViktorM commented on August 26, 2024

Also you should pip install mpi4py first and on Windows a few more actions were required to make mpi4py work.

from baselines.

iamzoumao avatar iamzoumao commented on August 26, 2024

If you set num_cpu = 4 and run run_atari.py again, you should observe around 17.0 mean reward in about 2k iterations.

However if you are working in Anaconda environment and have installed mpi4py via pip or conda install, this probably will report some errors like 'detected that one or more processes exited with non-zero status'. In this case, you should remove mpi4y and reinstall from source https://bitbucket.org/mpi4py/mpi4py instead.

from baselines.

ViktorM avatar ViktorM commented on August 26, 2024

Thanks @iamzoumao for the advice. With 4 num_cpu I see a bit different errors:

 File "run_atari2.py", line 54, in <module>
    main()
  File "run_atari2.py", line 51, in main
    train('PongNoFrameskip-v4', num_timesteps=40e6, seed=0, num_cpu=4)
  File "run_atari2.py", line 20, in train
    whoami  = mpi_fork(num_cpu)
  File "D:\baselines\baselines\common\mpi_fork.py", line 20, in mpi_fork
    subprocess.check_call(args, env=env)
  File "C:\Users\Viktor\Anaconda3\envs\deep-rl\lib\subprocess.py", line 576, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Users\Viktor\Anaconda3\envs\deep-rl\lib\subprocess.py", line 557, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\Viktor\Anaconda3\envs\deep-rl\lib\subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Viktor\Anaconda3\envs\deep-rl\lib\subprocess.py", line 1224, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

But will try reinstalling from source in any way, thanks.

from baselines.

nchentanez avatar nchentanez commented on August 26, 2024

Ran into the same problem as @ViktorM. Tried installing mpi4py from source, but got the same error.

from baselines.

nchentanez avatar nchentanez commented on August 26, 2024

Ok I got it to work:
First, install both the mpi run time and mpi SDK from
https://www.microsoft.com/en-us/download/details.aspx?id=55494

Then rename/copy
C:\Program Files\Microsoft MPI\Bin\mpiexec.exe
to
C:\Program Files\Microsoft MPI\Bin\mpirun.exe

or need to modify
baselines\common\mpi_fork.py
to call mpiexec instead, if running on Windows

from baselines.

KeirSimmons avatar KeirSimmons commented on August 26, 2024

Using ubuntu 16.04, and running these from a conda environment. Unable to run PPO or TRPO as I get the error that @iamzoumao stated. Was unable to make mpi4py from source. Any workaround for this?

from baselines.

ViktorM avatar ViktorM commented on August 26, 2024

@KeirSimmons for me on Ubuntu 16.04 just conda install mpi4py worked well.

from baselines.

olegklimov avatar olegklimov commented on August 26, 2024

We don't officially support Windows. It's great if it works, but we don't have Windows here anywhere. Please post a PR if you're able to fix a specific Windows problem.

from baselines.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.