numpy / numpy-tutorials

NumPy tutorials & educational content in notebook format
https://numpy.org/numpy-tutorials/
Other
494 stars 187 forks source link

The Pong tutorial: atari-py has been deprecated by Open AI #117

Open octopusinvitro opened 2 years ago

octopusinvitro commented 2 years ago

The Pong tutorial works with the currently pinned versions of gym and atari-py in the requirements.txt file. However, atari-py (which was the Open AI fork of the ALE), was deprecated in September 2021: https://github.com/openai/atari-py

The replacement is the original ALE, through the ale-py module: https://github.com/mgbellemare/Arcade-Learning-Environment

In September 2021, atari-py was finally replaced with ale-py in the gym official repository: https://github.com/openai/gym/pull/2348

In the gym release notes of October 2021, it specifies the correct way to install the ROMs from now on:

# requirements.txt
-gym==0.18.0
-atari-py==0.2.5
+gym[atari,accept-rom-license]

this will update these libraries while still making the tutorial work with no further changes.

Alternatively, this can be done instead:

# requirements.txt
-gym==0.18.0
-atari-py==0.2.5
+autorom~=0.4.2
+gym[atari]

this will install AutoROM independently and then in the docs the user has to be informed to run:

AutoROM --accept-license

This will also make the tutorial run with no further changes.

Regarding cmake, there is no need to install it anymore, as it was needed for atari-py. However, ffmpeg is still needed by gym's Monitor wrapper, as it produces videos of the agent’s learning.

I am happy to raise a PR for whichever of the two options if you want to go ahead with the update. I didn't want to do the PR directly because I don't know if it will be a problem for the numpy tutorials to accept this license. The commit in the numpy tutorials repo where the versions of gym and atari-py where pinned references a PR in the atari-py repository, which as mentioned before, has been deprecated.

Cheers!

P.S. Regarding this issue, it is now indeed trivial to update the library as all that needs to be done is install gym with the accept-rom-license extra, and everything will work, provided there is no issue for this tutorials to accept the license.

rossbar commented 2 years ago

Thanks for the nice summary of the situation and the info about autorom. Indeed this looks like a very straightforward fix provided there are no issues with the rom licenses. I haven't had a change to look at that yet, but I agree that needs to be reviewed before we can add it here.

Linking #87 for visibility

octopusinvitro commented 2 years ago

No worries, and thanks for taking a look!