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

[Bug Report] Rom not found after installing AutoRom #1160

Open
1 task done
MrCley opened this issue Jan 21, 2024 · 15 comments
Open
1 task done

[Bug Report] Rom not found after installing AutoRom #1160

MrCley opened this issue Jan 21, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@MrCley
Copy link

MrCley commented Jan 21, 2024

Describe the bug

When trying to run the Atari examples in the docs, the same error is shown (for all games):

OSError: rom tennis is not installed. Please install roms using AutoROM tool (https://github.com/Farama-Foundation/AutoROM) or specify and double-check the path to your Atari rom using the rom_path argument.

It says that the rom is not installed and suggests installing AutoROM, which is already installed (pip list below).

Full stack trace:

Traceback (most recent call last):
File "/Users/mrcley/Documents/py/marl_atari/src/train.py", line 3, in
env = tennis_v3.env(render_mode="human")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mrcley/Documents/py/marl_atari/env/lib/python3.11/site-packages/pettingzoo/atari/base_atari_env.py", line 25, in env_fn
env = raw_env_fn(**kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/Users/mrcley/Documents/py/marl_atari/env/lib/python3.11/site-packages/pettingzoo/atari/tennis/tennis.py", line 91, in raw_env
return BaseAtariEnv(
^^^^^^^^^^^^^
File "/Users/mrcley/Documents/py/marl_atari/env/lib/python3.11/site-packages/pettingzoo/atari/base_atari_env.py", line 34, in BaseAtariEnv
return parallel_to_aec_wrapper(ParallelAtariEnv(**kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mrcley/Documents/py/marl_atari/env/lib/python3.11/site-packages/pettingzoo/atari/base_atari_env.py", line 109, in init
raise OSError(
OSError: rom tennis is not installed. Please install roms using AutoROM tool (https://github.com/Farama-Foundation/AutoROM) or specify and double-check the path to your Atari rom using the rom_path argument.

Thanks!

Code example

from pettingzoo.atari import tennis_v3

env = tennis_v3.env(render_mode="human")
env.reset(seed=42)

for agent in env.agent_iter():
    observation, reward, termination, truncation, info = env.last()

    if termination or truncation:
        action = None
    else:
        # this is where you would insert your policy
        action = env.action_space(agent).sample()

    env.step(action)
env.close()

System info

M1 macOs Ventura 13.0.1
Python 3.11.6
pip list:

ale-py==0.8.1
AutoROM==0.6.1
AutoROM.accept-rom-license==0.6.1
certifi==2023.11.17
charset-normalizer==3.3.2
click==8.1.7
cloudpickle==3.0.0
Farama-Notifications==0.0.4
gymnasium==0.29.1
idna==3.6
importlib-resources==6.1.1
multi-agent-ale-py==0.1.11
numpy==1.26.3
pettingzoo==1.24.3
pygame==2.3.0
requests==2.31.0
Shimmy==0.2.1
tqdm==4.66.1
typing_extensions==4.9.0
urllib3==2.1.0

Additional context

AutoROM works fine in another project (same Python version) that is not using PettingZoo but is also using Gymnasium 0.29.1.

Checklist

  • I have checked that there is no similar issue in the repo
@MrCley MrCley added the bug Something isn't working label Jan 21, 2024
@elliottower
Copy link
Contributor

Can you give the full stack trace? We have testing in our CI for both linux/mac and python 3.8-3.11 which successfully installs the ROMs and tests them, I’ll check what versions are installed there though just to be sure

@elliottower
Copy link
Contributor

Oh what it might be is that we don’t explicitly test on M1 macs currently, but I believe that is now possible in GitHub actions so I could test it out

@MrCley
Copy link
Author

MrCley commented Jan 21, 2024

@elliottower that was fast! 😄
I've added the stack trace to the issue description. Thanks for looking into it!

@elliottower
Copy link
Contributor

elliottower commented Jan 22, 2024

The tests all passed on the different Mac versions (11, 12, and 13 with m1) so I think it must be something on your end

@pseudo-rnd-thoughts
Copy link
Member

Could you rerun pip install "gymnasium[accept-atari-roms]" then run

import gymnasium
gymnasium.make("ALE/Pong-v5")

@MrCley
Copy link
Author

MrCley commented Jan 25, 2024

Could you rerun pip install "gymnasium[accept-atari-roms]" then run

import gymnasium
gymnasium.make("ALE/Pong-v5")

if I install the gymnasium rom license (pip install 'gymnasium[accept-rom-license]'), and try the make() method, it does create the env.

But using the tennis_v3.env() provided in the docs, it still gives the error provided in the description above.

@pseudo-rnd-thoughts
Copy link
Member

@elliottower It seems like ale-py is doing something different from PettingZoo when finding the rom which is part of the issue

@jjshoots
Copy link
Member

Adding on, a good place to start debugging this is probably here. I can start looking into this later.

@jjshoots
Copy link
Member

jjshoots commented Feb 2, 2024

@MrCley I've looked into this and for some reason I cannot replicate this. Is this still happening on your end?

@MrCley
Copy link
Author

MrCley commented Feb 3, 2024

Hi @jjshoots, yes it still happens :(

I've made another project (also Python 3.11), cloned the repo and ran the tests (pip install -e .[testing,all] then pytest -v), they pass except the Atari ones, which fail because of the missing ROM.

@jjshoots
Copy link
Member

jjshoots commented Feb 3, 2024

@MrCley I assume you've done AutoROM -v?

@MrCley
Copy link
Author

MrCley commented Feb 3, 2024

yes, I ran the tests both before and after running AutoROM -v and got the same results

@jjshoots
Copy link
Member

jjshoots commented Feb 3, 2024

@MrCley I assume you're using some form of virtual env? If so, could you print out the contents of */lib/python3.10/site-packages/multi_agent_ale_py/roms? It should match the following:

 adventure.bin         fishing_derby.bin       pitfall.bin
 air_raid.bin          flag_capture.bin        pitfall2.bin
 alien.bin             freeway.bin             pong.bin
 amidar.bin            frogger.bin             pooyan.bin
 assault.bin           frostbite.bin           private_eye.bin
 asterix.bin           galaxian.bin            qbert.bin
 asteroids.bin         gopher.bin              riverraid.bin
 atlantis.bin          gravitar.bin            road_runner.bin
 atlantis2.bin         hangman.bin             robotank.bin
 backgammon.bin        haunted_house.bin       seaquest.bin
 bank_heist.bin        hero.bin                sir_lancelot.bin
 basic_math.bin        human_cannonball.bin    skiing.bin
 battle_zone.bin       ice_hockey.bin          solaris.bin
 beam_rider.bin        jamesbond.bin           space_invaders.bin
 berzerk.bin           journey_escape.bin      space_war.bin
 blackjack.bin         joust.bin               star_gunner.bin
 bowling.bin           kaboom.bin              superman.bin
 boxing.bin            kangaroo.bin            surround.bin
 breakout.bin          keystone_kapers.bin     tennis.bin
 carnival.bin          king_kong.bin           tetris.bin
 casino.bin            klax.bin                tic_tac_toe_3d.bin
 centipede.bin         koolaid.bin             time_pilot.bin
 chopper_command.bin   krull.bin               trondead.bin
 combat.bin            kung_fu_master.bin      turmoil.bin
 crazy_climber.bin     laser_gates.bin         tutankham.bin
 crossbow.bin          lost_luggage.bin        up_n_down.bin
 darkchambers.bin      mario_bros.bin          venture.bin
 defender.bin          maze_craze.bin          video_checkers.bin
 demon_attack.bin      miniature_golf.bin      video_chess.bin
 donkey_kong.bin       montezuma_revenge.bin   video_cube.bin
 double_dunk.bin       mr_do.bin               video_pinball.bin
 earthworld.bin        ms_pacman.bin           warlords.bin
 elevator_action.bin   name_this_game.bin      wizard_of_wor.bin
 enduro.bin            othello.bin             word_zapper.bin
 entombed.bin          pacman.bin              yars_revenge.bin
 et.bin                phoenix.bin             zaxxon.bin

@MrCley
Copy link
Author

MrCley commented Feb 3, 2024

hey @jjshoots, just checked and there is no roms folder in there:

Screenshot 2024-02-03 at 15 05 03

@jjshoots
Copy link
Member

jjshoots commented Feb 3, 2024

@MrCley Apologies for the repeated slow responses.

That does not look good...
Could you open up a Python interpreter within the venv, and run the following and send the output here?

import importlib.resources as r
r.files("multi_agent_ale_py")
r.files("AutoROM")

Also, could you verify that multi_agent_ale_py is not accidentally installed into the global python environment and only exists in the venv?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants