Retro Games in Gym

Overview

Status: Maintenance (expect bug fixes and minor updates)

Gym Retro

Gym Retro lets you turn classic video games into Gym environments for reinforcement learning and comes with integrations for ~1000 games. It uses various emulators that support the Libretro API, making it fairly easy to add new emulators.

Supported platforms:

  • Windows 7, 8, 10
  • macOS 10.13 (High Sierra), 10.14 (Mojave)
  • Linux (manylinux1)

CPU with SSSE3 or better

Supported Pythons:

  • 3.6
  • 3.7
  • 3.8

Each game integration has files listing memory locations for in-game variables, reward functions based on those variables, episode end conditions, savestates at the beginning of levels and a file containing hashes of ROMs that work with these files.

Please note that ROMs are not included and you must obtain them yourself. Most ROM hashes are sourced from their respective No-Intro SHA-1 sums.

Documentation

Documentation is available at https://retro.readthedocs.io/en/latest/

You should probably start with the Getting Started Guide.

Contributing

See CONTRIBUTING.md

Changelog

See CHANGES.md

Emulated Systems

  • Atari
    • Atari2600 (via Stella)
  • NEC
    • TurboGrafx-16/PC Engine (via Mednafen/Beetle PCE Fast)
  • Nintendo
    • Game Boy/Game Boy Color (via gambatte)
    • Game Boy Advance (via mGBA)
    • Nintendo Entertainment System (via FCEUmm)
    • Super Nintendo Entertainment System (via Snes9x)
  • Sega
    • GameGear (via Genesis Plus GX)
    • Genesis/Mega Drive (via Genesis Plus GX)
    • Master System (via Genesis Plus GX)

See LICENSES.md for information on the licenses of the individual cores.

Included ROMs

The following non-commercial ROMs are included with Gym Retro for testing purposes:

Citation

Please cite using the following BibTeX entry:

@article{nichol2018retro,
  title={Gotta Learn Fast: A New Benchmark for Generalization in RL},
  author={Nichol, Alex and Pfau, Vicki and Hesse, Christopher and Klimov, Oleg and Schulman, John},
  journal={arXiv preprint arXiv:1804.03720},
  year={2018}
}
Comments
  • Importing Atari Games with python -m retro.import

    Importing Atari Games with python -m retro.import

    Issue summary

    Hello, 😄

    I want to import Atari Space Invaders rom to retro. My rom name is "SpaceInvaders-Atari2600.a26" the same name as presented in the list of possible roms playable in retro and the correct format (.a26)

    However, when I want to import this rom to my retro environment using python -m retro.import. I receive this message:

    Importing 1 potential games...
    Imported 0 games
    
    

    So I tried to import it manually in Anaconda3\envs\gameplai\Lib\site-packages\retro\data\SpaceInvaders-Atari2600 by copy and paste the rom.

    But it didn't work:

    FileNotFoundError: Game not found: SpaceInvaders-Atari2600. Did you make sure to import the ROM?

    Do you know what should I do to fix this? I have only this problem when I try to import Atari games

    Again, this new library is awesome thanks for your work! 👏👏👏

    System information

    • Windows 10
    • Python 3.6.4
    • Retro 0.5.3
    opened by simoninithomas 35
  • Installation failed in windows 7

    Installation failed in windows 7

    Issue summary

    after cloning the repo and then want to install it(this section https://github.com/openai/retro#install-from-source) I get this error:

    Obtaining file:///C:/Users/Farshid/gym-retro Requirement already satisfied: gym in c:\users\farshid\appdata\local\programs\py thon\python36\lib\site-packages (from gym-retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: numpy>=1.10.4 in c:\users\farshid\appdata\local\p rograms\python\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18 b9d) Requirement already satisfied: requests>=2.0 in c:\users\farshid\appdata\local\p rograms\python\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18 b9d) Requirement already satisfied: six in c:\users\farshid\appdata\local\programs\py thon\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: pyglet>=1.2.0 in c:\users\farshid\appdata\local\p rograms\python\python36\lib\site-packages (from gym->gym-retro==0.5.4.dev9+gda18 b9d) Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\users\farshid\appdata \local\programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym- retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\users\farshid\appdata \local\programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym- retro==0.5.4.dev9+gda18b9d) Requirement already satisfied: certifi>=2017.4.17 in c:\users\farshid\appdata\lo cal\programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym-ret ro==0.5.4.dev9+gda18b9d) Requirement already satisfied: idna<2.7,>=2.5 in c:\users\farshid\appdata\local
    programs\python\python36\lib\site-packages (from requests>=2.0->gym->gym-retro== 0.5.4.dev9+gda18b9d) Requirement already satisfied: future in c:\users\farshid\appdata\local\programs \python\python36\lib\site-packages (from pyglet>=1.2.0->gym->gym-retro==0.5.4.de v9+gda18b9d) Installing collected packages: gym-retro Found existing installation: gym-retro 0.5.3 Uninstalling gym-retro-0.5.3: Successfully uninstalled gym-retro-0.5.3 Running setup.py develop for gym-retro Complete output from command c:\users\farshid\appdata\local\programs\python
    python36\python.exe -c "import setuptools, tokenize;file='C:\Users\Farshid \gym-retro\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read() .replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" develop --no-deps: running develop running egg_info writing gym_retro.egg-info\PKG-INFO writing dependency_links to gym_retro.egg-info\dependency_links.txt writing requirements to gym_retro.egg-info\requires.txt writing top-level names to gym_retro.egg-info\top_level.txt package init file 'data_init_.py' not found (or not a regular file) reading manifest template 'MANIFEST.in' warning: no previously-included files matching '.o' found anywhere in distr ibution warning: no previously-included files matching '.a' found anywhere in distr ibution warning: no previously-included files matching '.dylib' found anywhere in d istribution warning: no previously-included files matching '.so' found anywhere in dist ribution warning: no previously-included files matching '*-version' found under direc tory 'retro\cores' writing manifest file 'gym_retro.egg-info\SOURCES.txt' running build_ext error: [WinError 2] The system cannot find the file specified

    ----------------------------------------
    

    Rolling back uninstall of gym-retro Command "c:\users\farshid\appdata\local\programs\python\python36\python.exe -c " import setuptools, tokenize;file='C:\Users\Farshid\gym-retro\setup.py';f =getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f .close();exec(compile(code, file, 'exec'))" develop --no-deps" failed with e rror code 1 in C:\Users\Farshid\gym-retro\

    System information

    • Windows 7
    • Python 3.6.5
    • gym-retro 0.5.4
    opened by FarshidShekari 31
  • Could not find Makefile+Call Stack (most recent call first):   CMakeLists.txt:151 (add_core)

    Could not find Makefile+Call Stack (most recent call first): CMakeLists.txt:151 (add_core)

    Issue summary

    I tried many times to build [retro] through CMake, but the error is keep showing up. I don't know how to fix them. image

    image

    [Put a detailed description of the issue here.]

    System information

    • [Gym Retro version]: the newest
    opened by reginalluna 23
  • Cannot Render Env

    Cannot Render Env

    Issue summary

    I just wanted to test the streetfighter genesis ROM and I am able to create an environment out of the ROM. If I try to render it or plot the state it looks like this: emulator

    However if I try to open the ROM inside the UI-Integration it works out of the box.

    Do you have any ideas why this happens?

    System information

    • Ubuntu 18.04
    • Python 3.7 (in conda environment)
    • Gym Retro 0.6.0.dev45+g5af5926
    opened by justusschock 16
  • Instructions for Adding New Games/States

    Instructions for Adding New Games/States

    Issue summary

    There is no documentation that I can find that explains how to add new games or new states.

    By copying the site-packages/retro/data/SonicTheHedgehog-Genesis folder structure with a different ROM, I can get that ROM to show up as a game choice in retro.

    The README file in this repo explains that states are just emulator states, but gzipped. But when I use Genesis Plus GX to save state and then gzip and copy that state into the folder I created above, the state can get loaded but it does not seem to work.

    For example, when using SonicTheHedgehog-Genesis and saving a state in the GreenHillZone-Act1 stage, and then gzipping and putting that state into the SonicTheHedgehog-Genesis folder, I can load the state, but an agent cannot seem to control it.

    Details on the emulator core used (and version) and steps taken to produce a working state file would be much appreciated for those trying to add new games or states to retro.

    System information

    • OS: Windows 10
    • Python version: 3.6
    • Gym Retro version: 0.5.4
    opened by MaxStrange 15
  • No in-game sound

    No in-game sound

    Issue summary

    When rendering a game (e.g. Super Mario Bros.) using env.render() I get no in-game sound.

    I'm not sure if its supposed to have sound. If this is not a bug could you point me in the right direction? I would like to implement this my self, even if it doesn't get accepted, I'd like to use it. If it is a bug, same request :smile:. Thank you.

    System information

    • Ubuntu 18.04.1 LTS
    • Python 3.6.5
    • https://github.com/openai/retro/commit/684bd5f3db8a493a3a4c411f0654474e7af980ee
    enhancement 
    opened by axfcampos 14
  • My environment is rendered a few frames and then appears as lightblue screen.

    My environment is rendered a few frames and then appears as lightblue screen.

    Issue summary

    I'm trying to render the Sonic gameplay with PyCharm to see my A.I. performance, but the few things I get are a few frames (~10) and a light blue screen.

    Thanks in advance

    System information

    • [Hardware]: Ryzen 7 2700, GeForce 210
    • [Operating system]: Ubuntu 18.04
    • [Python version]: Python 3.6.5
    • [PyCharm version]: PyCharm 2018.1.4
    opened by YakoYakoYokuYoku 13
  • Installation error in windows 10

    Installation error in windows 10

    Issue summary

    Following error message is given during installation

     File "C:\Users\bikas\gym-retro\setup.py", line 46, in run
            pip.main(['install', 'cmake'])
        AttributeError: module 'pip' has no attribute 'main'
    
        ----------------------------------------
    Command "c:\users\bikas\anaconda3\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\bikas\\gym-retro\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps" failed with error code 1 in C:\Users\bikas\gym-retro\
    

    System information

    • Windows 10
    • Python 3.5.2
    • Gym Retro 0.5.4
    opened by ShuvenduRoy 12
  • Intense flickering of UI in retro integration tool

    Intense flickering of UI in retro integration tool

    When you load a rom in the integration tool, the UI starts to flicker.

    I generated a gif where I repro the bug: bug

    note: it flickers only when the game is running, not when paused

    System information

    Ubuntu 18.10 Python 3.6 gym-retro 0.7.0

    opened by MatPoliquin 11
  • Sonic 2 ROM not found

    Sonic 2 ROM not found

    Issue summary

    Whenever I try to run the environment in PyCharm it always gives the error that the ROM(game) is not found. Even thou Anaconda says I imported it, what am I doing wrong??

    System information

    • [Operating system] Win10
    • [Python version] Python 3.8
    • [Gym Retro version] 0.8.0
    opened by MysteriousHatter 10
  • Actions are a bit confusing

    Actions are a bit confusing

    I expected discrete actions to be filtered and actually wrote this in the docs but that doesn't appear to be the case. Seems like the interesting action spaces are: filtered multibinary (default), unfiltered multibinary (for replays), and filtered discrete (for approaches that require discrete actions).

    One approach would be to split filtering from the specific action space being used, so use_filtered_actions=True/False and then act_type=Multibinary,Discrete

    opened by christopherhesse 10
  • Bump setuptools from 40.5.0 to 65.5.1 in /docker/linux/build_scripts

    Bump setuptools from 40.5.0 to 65.5.1 in /docker/linux/build_scripts

    Bumps setuptools from 40.5.0 to 65.5.1.

    Release notes

    Sourced from setuptools's releases.

    v65.5.1

    No release notes provided.

    v65.5.0

    No release notes provided.

    v65.4.1

    No release notes provided.

    v65.4.0

    No release notes provided.

    v65.3.0

    No release notes provided.

    v65.2.0

    No release notes provided.

    v65.1.1

    No release notes provided.

    v65.1.0

    No release notes provided.

    v65.0.2

    No release notes provided.

    v65.0.1

    No release notes provided.

    v65.0.0

    No release notes provided.

    v64.0.3

    No release notes provided.

    v64.0.2

    No release notes provided.

    v64.0.1

    No release notes provided.

    v64.0.0

    No release notes provided.

    v63.4.3

    No release notes provided.

    v63.4.2

    No release notes provided.

    ... (truncated)

    Changelog

    Sourced from setuptools's changelog.

    v65.5.1

    Misc ^^^^

    • #3638: Drop a test dependency on the mock package, always use :external+python:py:mod:unittest.mock -- by :user:hroncok
    • #3659: Fixed REDoS vector in package_index.

    v65.5.0

    Changes ^^^^^^^

    • #3624: Fixed editable install for multi-module/no-package src-layout projects.
    • #3626: Minor refactorings to support distutils using stdlib logging module.

    Documentation changes ^^^^^^^^^^^^^^^^^^^^^

    • #3419: Updated the example version numbers to be compliant with PEP-440 on the "Specifying Your Project’s Version" page of the user guide.

    Misc ^^^^

    • #3569: Improved information about conflicting entries in the current working directory and editable install (in documentation and as an informational warning).
    • #3576: Updated version of validate_pyproject.

    v65.4.1

    Misc ^^^^

    v65.4.0

    Changes ^^^^^^^

    v65.3.0

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump wheel from 0.31.1 to 0.38.1 in /docker/linux/build_scripts

    Bump wheel from 0.31.1 to 0.38.1 in /docker/linux/build_scripts

    Bumps wheel from 0.31.1 to 0.38.1.

    Changelog

    Sourced from wheel's changelog.

    Release Notes

    UNRELEASED

    • Updated vendored packaging to 22.0

    0.38.4 (2022-11-09)

    • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

    0.38.3 (2022-11-08)

    • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

    0.38.2 (2022-11-05)

    • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

    0.38.1 (2022-11-04)

    • Removed install dependency on setuptools
    • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

    0.38.0 (2022-10-21)

    • Dropped support for Python < 3.7
    • Updated vendored packaging to 21.3
    • Replaced all uses of distutils with setuptools
    • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
    • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
    • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

    0.37.1 (2021-12-22)

    • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
    • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

    0.37.0 (2021-08-09)

    • Added official Python 3.10 support
    • Updated vendored packaging library to v20.9

    ... (truncated)

    Commits
    • 6f1608d Created a new release
    • cf8f5ef Moved news item from PR #484 to its proper place
    • 9ec2016 Removed install dependency on setuptools (#483)
    • 747e1f6 Fixed PyPy SOABI parsing (#484)
    • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
    • 7b9e8e1 Test on Python 3.11 final
    • a04dfef Updated the pypi-publish action
    • 94bb62c Fixed docs not building due to code style changes
    • d635664 Updated the codecov action to the latest version
    • fcb94cd Updated version to match the release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • two agent competing environment

    two agent competing environment

    Hello,

    It would be nice if anyone could help me to integrate Mortal Kombat II Genesis in to two player (one could be previous version of the same model which is just performing actions based on observations) training environment. For example, how to pass action space for the second player in the way that the first one would not be able to use it? My email is [email protected].

    Merry Christmas!

    Best regards, Roberts

    opened by Franko9999 0
  • Bump certifi from 2018.10.15 to 2022.12.7 in /docker/linux/build_scripts

    Bump certifi from 2018.10.15 to 2022.12.7 in /docker/linux/build_scripts

    Bumps certifi from 2018.10.15 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Can't load roms in gym

    Can't load roms in gym

    Issue summary

    [Hi, I was setting up my project on a new pc and when I run my code I get this error:

    ---------------------------------------------------------------------------
    FileNotFoundError                         Traceback (most recent call last)
    Input In [1], in <cell line: 2>()
          1 #Import Dependencies
    ----> 2 import gym
          3 from stable_baselines3 import A2C
          4 from stable_baselines3.common.vec_env import VecFrameStack
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\__init__.py:15, in <module>
          7 from gym.core import (
          8     Env,
          9     Wrapper,
       (...)
         12     RewardWrapper,
         13 )
         14 from gym.spaces import Space
    ---> 15 from gym.envs import make, spec, register
         16 from gym import logger
         17 from gym import vector
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\envs\__init__.py:5, in <module>
          2 from gym.envs.registration import make, register, registry, spec
          4 # Hook to load plugins from entry points
    ----> 5 _load_env_plugins()
          8 # Classic
          9 # ----------------------------------------
         11 register(
         12     id="CartPole-v0",
         13     entry_point="gym.envs.classic_control.cartpole:CartPoleEnv",
         14     max_episode_steps=200,
         15     reward_threshold=195.0,
         16 )
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\envs\registration.py:321, in load_env_plugins(entry_point)
        314         logger.warn(
        315             f"The environment namespace magic key `{plugin.name}` is unsupported. "
        316             "To register an environment at the root namespace you should specify "
        317             "the `__root__` namespace."
        318         )
        320 with context:
    --> 321     fn = plugin.load()
        322     try:
        323         fn()
    
    File ~\AppData\Local\Programs\Python\Python310\lib\importlib\metadata\__init__.py:171, in EntryPoint.load(self)
        166 """Load the entry point from its definition. If only a module
        167 is indicated by the value, return that module. Otherwise,
        168 return the named object.
        169 """
        170 match = self.pattern.match(self.value)
    --> 171 module = import_module(match.group('module'))
        172 attrs = filter(None, (match.group('attr') or '').split('.'))
        173 return functools.reduce(getattr, attrs, module)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py:126, in import_module(name, package)
        124             break
        125         level += 1
    --> 126 return _bootstrap._gcd_import(name[level:], package, level)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\gym.py:5, in <module>
          1 from collections import defaultdict, namedtuple
          3 from gym.envs.registration import register
    ----> 5 from ale_py.roms.utils import rom_name_to_id, rom_id_to_name
          8 GymFlavour = namedtuple("GymFlavour", ["suffix", "env_kwargs", "kwargs"])
          9 GymConfig = namedtuple("GymConfig", ["version", "env_kwargs", "flavours"])
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\roms\__init__.py:89, in <module>
         85     return roms
         88 # Resolve all ROMs
    ---> 89 ROMS = resolve_roms()
         90 __all__ = list(ROMS.keys())
         93 def __dir__() -> List[str]:
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\roms\__init__.py:40, in resolve_roms()
         36 for package in ROM_PLUGINS:
         38     try:
         39         # Resolve supported / unsupported roms
    ---> 40         supported, unsupported = package.resolve()
         42         # We'll now get the update delta. The reason for this is two fold:
         43         #     1) We should only display atari-py deprecation when it would have
         44         #        imported ROMs.
         45         #     2) ROM priority holds. When you import ROMs they'll all come from
         46         #        a single source of truth.
         47         #
         48         roms_delta_keys = list(
         49             filter(lambda rom: rom not in roms, supported.keys())
         50         )
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\ale_py\roms\utils.py:60, in SupportedPackage.resolve(self)
         56 unsupported: List[pathlib.Path] = []
         58 # Iterate over all ROMs in the specified package
         59 for resource in filter(
    ---> 60     lambda file: file.suffix == ".bin", resources.files(self.package).iterdir()
         61 ):
         62     resolved = resource.resolve()
         63     rom = ALEInterface.isSupportedROM(resolved)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\importlib_resources\_common.py:22, in files(package)
         17 def files(package):
         18     # type: (Package) -> Traversable
         19     """
         20     Get a Traversable resource from a package
         21     """
    ---> 22     return from_package(get_package(package))
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\importlib_resources\_common.py:53, in get_package(package)
         47 def get_package(package):
         48     # type: (Package) -> types.ModuleType
         49     """Take a package name or module object and return the module.
         50 
         51     Raise an exception if the resolved module is not a package.
         52     """
    ---> 53     resolved = resolve(package)
         54     if wrap_spec(resolved).submodule_search_locations is None:
         55         raise TypeError(f'{package!r} is not a package')
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\importlib_resources\_common.py:44, in resolve(cand)
         42 def resolve(cand):
         43     # type: (Package) -> types.ModuleType
    ---> 44     return cand if isinstance(cand, types.ModuleType) else importlib.import_module(cand)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py:126, in import_module(name, package)
        124             break
        125         level += 1
    --> 126 return _bootstrap._gcd_import(name[level:], package, level)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\atari_py\__init__.py:1, in <module>
    ----> 1 from .ale_python_interface import *
          2 from .games import get_game_path, list_games
          4 # default to only logging errors
    
    File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\atari_py\ale_python_interface.py:17, in <module>
         14     ale_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__),
         15                                             'ale_interface/libale_c.so'))
         16 else:
    ---> 17     ale_lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__),
         18                                             'ale_interface/ale_c.dll'))
         20 ale_lib.ALE_new.argtypes = None
         21 ale_lib.ALE_new.restype = c_void_p
    
    File ~\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py:452, in LibraryLoader.LoadLibrary(self, name)
        451 def LoadLibrary(self, name):
    --> 452     return self._dlltype(name)
    
    File ~\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py:374, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
        371 self._FuncPtr = _FuncPtr
        373 if handle is None:
    --> 374     self._handle = _dlopen(self._name, mode)
        375 else:
        376     self._handle = handle
    
    FileNotFoundError: Could not find module 'C:\Users\shiva\AppData\Local\Programs\Python\Python310\lib\site-packages\atari_py\ale_interface\ale_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.
    

    Code:

    import gym
    from stable_baselines3 import A2C
    from stable_baselines3.common.vec_env import VecFrameStack
    from stable_baselines3.common.evaluation import evaluate_policy
    from stable_baselines3.common.env_util import make_atari_env
    from stable_baselines3.common.env_util import make_vec_env
    
    import os
    from gym.utils import play
    from stable_baselines3.ddpg.policies import CnnPolicy
    from ale_py import ALEInterface
    
    ale = ALEInterface()
    from ale_py.roms import Breakout
    
    ale.loadROM(Breakout)
    env = gym.make('Breakout-v4', render_mode='human')
    env = VecFrameStack(make_atari_env("BreakoutNoFrameskip-v4"), n_stack=4)
    model = A2C.load(r"C:\Users\shiva\Documents\Atari_Breakout_RL_Project\Training\Logs\BreakoutNoFrameskipv4", env=env)
    mean_reward, std_reward = evaluate_policy(model, model.get_env(), n_eval_episodes=10, render=True)
    

    I have also installed the c++ build tools from microsoft's website. i am very confused as the same thing works on my older pc. Please help.

    ]

    System information

    • [OS - Windows 11]
    • [Python version - 3.10]
    • [Gym version - latest]
    opened by Shivam310 3
  • Hexadecimal memory locations for data.json

    Hexadecimal memory locations for data.json

    Currently, it appears that JSON not support hexadecimal memory addresses. What is the correct way to handle mapping these addresses?

    For example, my data.json file for the GameBoy game Super Mario Land looks like the following:

    {
      "info": {
        "gameover": {
          "address": C0A4,
          "type": "=d1"
        },
        "lives": {
          "address": DA15,
          "type": "=d1"
        },
        "coins-tens": {
          "address": 9829,
          "type": "=d1"
        },
        "coins-ones": {
          "address": 982A,
          "type": "=d1"
        },
        "current-world": {
          "address": 982C,
          "type": "=d1"
        },
        "current-stage": {
          "address": 982E,
          "type": "=d1"
        },
        "mario-x-pos": {
          "address": C202,
          "type": "=d1"
        },
        "mario-y-pos": {
          "address": C201,
          "type": "=d1"
        },
        "score": {
          "address": C0A0,
          "type": "=d4"
        }
      }
    }
    

    This, naturally, will fail to import, since the JSON parser has no idea about how to read those hexadecimal values. Do we just convert from hex to decimal, i.e., 0xC0A4 becomes 49316?

    Thank you!

    opened by isledge 1
Owner
OpenAI
OpenAI
Dopamine is a research framework for fast prototyping of reinforcement learning algorithms.

Dopamine Dopamine is a research framework for fast prototyping of reinforcement learning algorithms. It aims to fill the need for a small, easily grok

Google 10k Jan 07, 2023
A general-purpose multi-agent training framework.

MALib A general-purpose multi-agent training framework. Installation step1: build environment conda create -n malib python==3.7 -y conda activate mali

MARL @ SJTU 346 Jan 03, 2023
Retro Games in Gym

Status: Maintenance (expect bug fixes and minor updates) Gym Retro Gym Retro lets you turn classic video games into Gym environments for reinforcement

OpenAI 2.8k Jan 03, 2023
TF-Agents: A reliable, scalable and easy to use TensorFlow library for Contextual Bandits and Reinforcement Learning.

TF-Agents: A reliable, scalable and easy to use TensorFlow library for Contextual Bandits and Reinforcement Learning. TF-Agents makes implementing, de

2.4k Dec 29, 2022
Paddle-RLBooks is a reinforcement learning code study guide based on pure PaddlePaddle.

Paddle-RLBooks Welcome to Paddle-RLBooks which is a reinforcement learning code study guide based on pure PaddlePaddle. 欢迎来到Paddle-RLBooks,该仓库主要是针对强化学

AgentMaker 117 Dec 12, 2022
Tensorforce: a TensorFlow library for applied reinforcement learning

Tensorforce: a TensorFlow library for applied reinforcement learning Introduction Tensorforce is an open-source deep reinforcement learning framework,

Tensorforce 3.2k Jan 02, 2023
Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms

Coach Coach is a python reinforcement learning framework containing implementation of many state-of-the-art algorithms. It exposes a set of easy-to-us

Intel Labs 2.2k Jan 05, 2023
Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

SLM Lab Modular Deep Reinforcement Learning framework in PyTorch. Documentation: https://slm-lab.gitbook.io/slm-lab/ BeamRider Breakout KungFuMaster M

Wah Loon Keng 1.1k Dec 24, 2022
ChainerRL is a deep reinforcement learning library built on top of Chainer.

ChainerRL ChainerRL is a deep reinforcement learning library that implements various state-of-the-art deep reinforcement algorithms in Python using Ch

Chainer 1.1k Dec 26, 2022
An open source robotics benchmark for meta- and multi-task reinforcement learning

Meta-World Meta-World is an open-source simulated benchmark for meta-reinforcement learning and multi-task learning consisting of 50 distinct robotic

Reinforcement Learning Working Group 823 Jan 06, 2023
Rethinking the Importance of Implementation Tricks in Multi-Agent Reinforcement Learning

MARL Tricks Our codes for RIIT: Rethinking the Importance of Implementation Tricks in Multi-AgentReinforcement Learning. We implemented and standardiz

404 Dec 25, 2022
A customisable 3D platform for agent-based AI research

DeepMind Lab is a 3D learning environment based on id Software's Quake III Arena via ioquake3 and other open source software. DeepMind Lab provides a

DeepMind 6.8k Jan 05, 2023
A fork of OpenAI Baselines, implementations of reinforcement learning algorithms

Stable Baselines Stable Baselines is a set of improved implementations of reinforcement learning algorithms based on OpenAI Baselines. You can read a

Ashley Hill 3.7k Jan 01, 2023
Doom-based AI Research Platform for Reinforcement Learning from Raw Visual Information. :godmode:

ViZDoom ViZDoom allows developing AI bots that play Doom using only the visual information (the screen buffer). It is primarily intended for research

Marek Wydmuch 1.5k Dec 30, 2022
Monitor your el-cheapo UPS via SNMP

UPSC-SNMP-Agent UPSC-SNMP-Agent exposes your el-cheapo locally connected UPS via the SNMP network management protocol. This enables various equipment

Tom Szilagyi 32 Jul 28, 2022
A toolkit for reproducible reinforcement learning research.

garage garage is a toolkit for developing and evaluating reinforcement learning algorithms, and an accompanying library of state-of-the-art implementa

Reinforcement Learning Working Group 1.6k Jan 09, 2023
Game Agent Framework. Helping you create AIs / Bots that learn to play any game you own!

Serpent.AI - Game Agent Framework (Python) Update: Revival (May 2020) Development work has resumed on the framework with the aim of bringing it into 2

Serpent.AI 6.4k Jan 05, 2023
This is the official implementation of Multi-Agent PPO.

MAPPO Chao Yu*, Akash Velu*, Eugene Vinitsky, Yu Wang, Alexandre Bayen, and Yi Wu. Website: https://sites.google.com/view/mappo This repository implem

653 Jan 06, 2023
OpenAI Baselines: high-quality implementations of reinforcement learning algorithms

Status: Maintenance (expect bug fixes and minor updates) Baselines OpenAI Baselines is a set of high-quality implementations of reinforcement learning

OpenAI 13.5k Jan 07, 2023
A platform for Reasoning systems (Reinforcement Learning, Contextual Bandits, etc.)

Applied Reinforcement Learning @ Facebook Overview ReAgent is an open source end-to-end platform for applied reinforcement learning (RL) developed and

Facebook Research 3.3k Jan 05, 2023