OpenAI Retro Contest – How To Install Gym Retro – Possible Problems

If you want to learn more about Machine Learning and AI there is great contest running on https://contest.openai.com/

How to install retro environment you can find on: https://contest.openai.com/details and on github https://github.com/openai/retro

The guide how to install all modules is great, but problems can still arise. After four days of trying i finally made it and it finally works!

System: Windows 10, 64 Bit.

So… what did i do wrong? Why did i took me so long?

– python 3.6.5 but 32- bit version

– installed gcc the wrong way

– tried to install gcc manually

– tried running through pyCharm.

So let’s start with with Python Version:

https://github.com/openai/retro/issues/32

You can find out what kind of version of python you have by looking at the Icon name. If you have 32 Bit Version it won’t work.

https://www.python.org/downloads/windows/

You need to install 64 bit Python. My version is : Python 3.6.5 – 2018-03-28

Installing GCC

One of the requirements to run retro gym is gcc 5 or higher.

I did it through cygwin.

Download 64 bit version from:

https://cygwin.com/install.html

And follow this tutorial:

http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/

Possible problems:

You need to copy setup-x86_64.exe from downloads to your cygwin folder.

You run this command thought cmd in your cygwin folder:

(Don’t forget, it is CMD not Cygwin!)

C:\cygwin64>setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel won't work. Also if you are currently in the project folder you can just write: setup-x86_64.exe -q -P wget -P gcc-g++ -P make -P diffutils -P libmpfr-devel -P libgmp-devel -P libmpc-devel

If you are getting the gcc package don’t forget to change

wget http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz

to:

wget http://ftpmirror.gnu.org/gcc/gcc-7.3.0/gcc-7.3.0.tar.gz

We want the newer version after all. The same thing here:

../gcc-4.9.2/configure --program-suffix=-4.9.2 --enable-languages=c,c++ --disable-bootstrap --disable-shared

replace with:

../gcc-7.3.0/configure --program-suffix=-7.3.0 --enable-languages=c,c++ --disable-bootstrap --disable-shared

At the end you should test the compiler. If it works we are ready to go!

Install from binary

Next you can install environment through pip3:

pip3 install gym-retro

Running through pyCharm

On the details page: https://contest.openai.com/details

There is this script:

import retro


def main():
    env = retro.make(game='Airstriker-Genesis', state='Level1')
    obs = env.reset()
    while True:
        obs, rew, done, info = env.step(env.action_space.sample())
        env.render()
        if done:
            obs = env.reset()


if __name__ == '__main__':
    main()

But if you run it through IDE you get this:


C:\Users\programmer\PycharmProjects\untitled1\venv\Scripts\python.exe C:/Users/programmer/PycharmProjects/untitled1/retro-agent.py
Traceback (most recent call last):
File "C:/Users/programmer/PycharmProjects/untitled1/retro-agent.py", line 1, in <module>
import retro
ModuleNotFoundError: No module named 'retro'

Process finished with exit code 1

The thing is you need to run this script through terminal. Just run your script in terminal :

python retro-agent.py

And you should get the ai playing the game Airstriker-Genesis on our screen.

Other problems:

Don’t forget to Add Python to your PATH!

GCC Needs to be 5 or Higher!

64 Bit versions of programs!

Run the retro-agent.py throught terminal!

Installing from source, possible problems:

https://github.com/openai/retro/issues/30


					

One thought to “OpenAI Retro Contest – How To Install Gym Retro – Possible Problems”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.