Closed adauphin closed 7 years ago
Please make sure that binary dependencies are installed; they are spelled out on the GitHub page. On the other hand, I have a difficult time getting it right: the code is outdated and not the highest quality. I will try to fix it over the coming days.
Okay, this is fairly involved, but it can be done. I got it right with Python 3.6 (system version, not in Anaconda) running on Arch Linux, but I will try it using Anaconda too. First, install every OpenAI Gym packages from PyPI:
pip install gym[all]
This enables most games, including non-trivial ones, such as Pacman. This should run fine:
import gym
env = gym.make('MsPacman-v0')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample()) # take a random action
Then comes the tricky part. Ensure that the dependencies of ZDoom and VizDoom are there. You don't actually need to download or compile ZDoom or VizDoom: you only need the dependencies. Once this is ensured, this should install fine:
pip install doom_py
If there are no errors, install the final Python module that you need:
pip install ppaquette-gym-doom
If your stars are lucky, you can get your agent to shoot:
import gym
import ppaquette_gym_doom
env = gym.make('ppaquette/DoomBasic-v0')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample()) # take a random action
Please tell me if you can get it working with Mac. Thanks.
To get started with the solution, clone this fork of async-rl. This is somewhat outdated, so you have to make some changes in run_a3c.py
:
gym.envs.doom.doom_env
with ppaquette_gym_doom.doom_env
in line 10.import gym.wrappers
.env.monitor.start(os.path.join(args.outdir, 'gym-monitor'))
to env = gym.wrappers.Monitor(env, os.path.join(args.outdir, 'gym-monitor'))
.In async-rl/prepare_output_dir.py
, delete lines 37-50. Then, install the dependencies:
pip install chainer
pip install cached_property
Now issuing this command will train your agent:
python run_a3c.py --env ppaquette/DoomBasic-v0 --threads 4 --outdir outdir --act-filter doom-minimal
You can watch the videos in outdir
as the agent learns. On my laptop, the estimated training time is 400 hours, so it does not make a great first example.
I have installed gym[all] and all the dependencies appearing on the website, but it is still not working for the installation of doom_py. In particular, I have followed the recommendation:
HINT: are you sure cmake is installed? You might also be missing a library. doom_py requires boost, boost-python, sdl2 on OSX (installable via 'brew install boost boost-python sdl2')
and installed boost, boost-python and sdl2 ( but not with homebrew).
It is pretty intricate and the only way I could compile it is when the VizDoom and ZDoom dependencies were all installed, along with their header files. In any case, I modified the homework to make it a lot easier to set it up -- this Doom framework is way too complicated.
Hi,
I tried to install gym_pull (needed to set up the doom environment) on my mac but it failed. It seems that some dependencies are missing. I also tried the second method by installing ppaquette-gym-doom but I get the following error:
Regards,
Alexandre