Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed OpenAI ROM Missing Error: "Exception: ROM is missing for pong" - Lab 3 #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ryanboldi
Copy link

Exception 
Traceback (most recent call last)
<ipython-input-2-7af2597d0a5a> in <module>()
      1 def create_pong_env():
      2   return gym.make("Pong-v0", frameskip=5)
----> 3 env = create_pong_env()
      4 env.seed(1); # for reproducibility

5 frames
/usr/local/lib/python3.7/dist-packages/atari_py/games.py in get_game_path(game_name)
     18     path = os.path.join(_games_dir, game_name) + ".bin"
     19     if not os.path.exists(path):
---> 20         raise Exception('ROM is missing for %s, see https://github.com/openai/atari-py#roms for instructions' % (game_name,))
     21     return path
     22 

Exception: ROM is missing for pong, see https://github.com/openai/atari-py#roms for instructions

To fix this error, the Atari ROMs were added to the repository as .zip files, and the ipython files were updated to include importing these files into the current running google colab instance.

Here is the added code:

from google.colab import files
# The following command will open an upload window. 
# To load the pong ROMs, please upload both HC_ROMS.zip and ROMS.zip to this window.
uploaded = files.upload()

!pip install atari_py

!python -m atari_py.import_roms .

def create_pong_env(): 
  return gym.make("Pong-v0", frameskip=5)
env = create_pong_env()
env.seed(1); # for reproducibility

The upload procedure takes about a minute to complete, but considering the fact that the penultimate code block takes a couple hours, I think that should be fine in the grand scheme of things.

I'm sure there is a better way to fix this error, but this workaround works sufficiently well for the task.

@ryanboldi ryanboldi changed the title Fixed OpenAI ROM Missing Error: "Exception: ROM is missing for pong" Fixed OpenAI ROM Missing Error: "Exception: ROM is missing for pong" - Lab 3 Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant