|
52 | 52 | "\n",
|
53 | 53 | "if IS_COLAB or IS_KAGGLE:\n",
|
54 | 54 | " !apt update && apt install -y libpq-dev libsdl2-dev swig xorg-dev xvfb\n",
|
55 |
| - " %pip install -q -U tf-agents pyvirtualdisplay gym[box2d,atari] AutoROM\n", |
| 55 | + " %pip install -U tf-agents pyvirtualdisplay\n", |
| 56 | + " %pip install -U gym>=0.21.0\n", |
| 57 | + " %pip install -U gym[box2d,atari,accept-rom-license]\n", |
56 | 58 | "\n",
|
57 | 59 | "# Scikit-Learn ≥0.20 is required\n",
|
58 | 60 | "import sklearn\n",
|
|
2180 | 2182 | "Let's use TF-Agents to create an agent that will learn to play Breakout. We will use the Deep Q-Learning algorithm, so you can easily compare the components with the previous implementation, but TF-Agents implements many other (and more sophisticated) algorithms!"
|
2181 | 2183 | ]
|
2182 | 2184 | },
|
2183 |
| - { |
2184 |
| - "cell_type": "markdown", |
2185 |
| - "metadata": {}, |
2186 |
| - "source": [ |
2187 |
| - "First, we need to download and install the Atari ROMs. This can be done very easily using the `AutoROM` tool, if you accept the license:" |
2188 |
| - ] |
2189 |
| - }, |
2190 |
| - { |
2191 |
| - "cell_type": "code", |
2192 |
| - "execution_count": 78, |
2193 |
| - "metadata": {}, |
2194 |
| - "outputs": [ |
2195 |
| - { |
2196 |
| - "name": "stdout", |
2197 |
| - "output_type": "stream", |
2198 |
| - "text": [ |
2199 |
| - "AutoROM will download the Atari 2600 ROMs.\n", |
2200 |
| - "They will be installed to:\n", |
2201 |
| - "\t/Users/ageron/miniconda3/envs/tf2/lib/python3.8/site-packages/AutoROM/roms\n", |
2202 |
| - "\n", |
2203 |
| - "Existing ROMs will be overwritten.\n", |
2204 |
| - "Done! \n" |
2205 |
| - ] |
2206 |
| - } |
2207 |
| - ], |
2208 |
| - "source": [ |
2209 |
| - "if IS_COLAB:\n", |
2210 |
| - " !{sys.prefix}/local/bin/AutoROM --quiet --accept-license\n", |
2211 |
| - "else:\n", |
2212 |
| - " !{sys.prefix}/bin/AutoROM --quiet --accept-license" |
2213 |
| - ] |
2214 |
| - }, |
2215 | 2185 | {
|
2216 | 2186 | "cell_type": "markdown",
|
2217 | 2187 | "metadata": {},
|
|
0 commit comments