Spaces:
Runtime error
Runtime error
Jarvis
commited on
Commit
·
1e09779
1
Parent(s):
649d591
Remove duplicate instruction for atari env installation
Browse files
README.md
CHANGED
@@ -90,59 +90,12 @@ pip install cython==0.29.37
|
|
90 |
|
91 |
If you encounter the error `Unable to find game "[env_name]"` when running a script for Atari environments, it may be due to the absence of Atari ROMs in the `atari_py` package since version 0.2.7. To resolve this issue, you can manually download the ROMs and add them to Gym's registry.
|
92 |
|
93 |
-
#### Update: A simplified solution
|
94 |
-
|
95 |
``` shell
|
96 |
pip install gym[accept-rom-license]
|
97 |
AutoROM --accept-license
|
98 |
```
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
#### Step 1: Download ROMs and Install Dependencies
|
103 |
-
Create a new Jupyter notebook (e.g., at the root directory of this project) and run the following code cell just once. This code block downloads the ROMs and installs the necessary dependencies (`unrar` and `atari_py`):
|
104 |
-
|
105 |
-
```python
|
106 |
-
import urllib.request
|
107 |
-
|
108 |
-
# Download the Atari ROMs
|
109 |
-
urllib.request.urlretrieve("http://www.atarimania.com/roms/Roms.rar", "Roms.rar")
|
110 |
-
|
111 |
-
# Install dependencies
|
112 |
-
!pip install unrar
|
113 |
-
!pip install atari_py
|
114 |
-
|
115 |
-
# Extract the ROMs
|
116 |
-
!unrar x Roms.rar
|
117 |
-
|
118 |
-
# Organize and compress ROM folders
|
119 |
-
!mkdir rars
|
120 |
-
!zip HC\ ROMS.zip HC\ ROMS
|
121 |
-
!zip ROMS.zip ROMS
|
122 |
-
|
123 |
-
# Clean up extracted folders
|
124 |
-
!rm -r HC\ ROMS
|
125 |
-
!rm -r ROMS
|
126 |
-
|
127 |
-
# Move zipped ROMS to the rars folder
|
128 |
-
!mv HC\ ROMS.zip rars
|
129 |
-
!mv ROMS.zip rars
|
130 |
-
```
|
131 |
-
|
132 |
-
#### Step 2: Import ROMs to Atari-Py
|
133 |
-
Now, use the following lines within the same notebook to import the ROMs to `atari_py`:
|
134 |
-
|
135 |
-
```python
|
136 |
-
# Import ROMs to atari_py
|
137 |
-
!python -m atari_py.import_roms rars
|
138 |
-
|
139 |
-
# Clean up downloaded files and folders
|
140 |
-
!rm -r rars
|
141 |
-
!rm Roms.rar
|
142 |
-
```
|
143 |
-
|
144 |
-
#### Step 3: Test the Imported ROMs
|
145 |
-
Test the imported ROMs by running the following Python code in your Jupyter notebook:
|
146 |
|
147 |
```python
|
148 |
import gym
|
@@ -161,4 +114,4 @@ print(info["labels"])
|
|
161 |
|
162 |
If everything runs smoothly, you have successfully imported the Atari ROMs and set up your environment.
|
163 |
|
164 |
-
Reference: [StackOverflow answer](https://stackoverflow.com/a/68143504/38626)
|
|
|
90 |
|
91 |
If you encounter the error `Unable to find game "[env_name]"` when running a script for Atari environments, it may be due to the absence of Atari ROMs in the `atari_py` package since version 0.2.7. To resolve this issue, you can manually download the ROMs and add them to Gym's registry.
|
92 |
|
|
|
|
|
93 |
``` shell
|
94 |
pip install gym[accept-rom-license]
|
95 |
AutoROM --accept-license
|
96 |
```
|
97 |
|
98 |
+
Test with the following code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
```python
|
101 |
import gym
|
|
|
114 |
|
115 |
If everything runs smoothly, you have successfully imported the Atari ROMs and set up your environment.
|
116 |
|
117 |
+
Reference: [StackOverflow answer](https://stackoverflow.com/a/68143504/38626)
|