|
8 | 8 | "outputs": [],
|
9 | 9 | "source": [
|
10 | 10 | "!pip install gym[atari]\n",
|
| 11 | + "!pip install gym[accept-rom-license]\n", |
11 | 12 | "!pip install ray==1.2 matplotlib\n",
|
12 | 13 | "!pip install dm-tree dataclasses ray[rllib]"
|
13 | 14 | ]
|
|
31 | 32 | "id": "ec1fe0b7",
|
32 | 33 | "metadata": {},
|
33 | 34 | "outputs": [],
|
| 35 | + "source": [ |
| 36 | + "import os\n", |
| 37 | + "import subprocess\n", |
| 38 | + "\n", |
| 39 | + "\n", |
| 40 | + "def system_cmd(cmd_list):\n", |
| 41 | + " cmd = subprocess.run(cmd_list, shell=False)\n", |
| 42 | + " if cmd.returncode != 0:\n", |
| 43 | + " print('cannot exec cmd: {}, exit with {}'.format(cmd_list, cmd.returncode))\n", |
| 44 | + " raise EnvironmentError\n", |
| 45 | + " return\n", |
| 46 | + "\n", |
| 47 | + "\n", |
| 48 | + "def install_gym(mode=None):\n", |
| 49 | + " if mode is not None:\n", |
| 50 | + " p_path = os.environ.get('SITE_PACKAGES_PATH', '/home/ma-user/anaconda/lib/python3.6/site-packages')\n", |
| 51 | + " file_path = os.path.join(p_path, 'AutoROM/roms')\n", |
| 52 | + " target = os.path.join(p_path, 'atari_py/atari_roms')\n", |
| 53 | + " system_cmd(['cp', '-rf', file_path, target])\n", |
| 54 | + " return\n", |
| 55 | + "\n", |
| 56 | + "\n", |
| 57 | + "install_gym(mode='atari')" |
| 58 | + ] |
| 59 | + }, |
| 60 | + { |
| 61 | + "cell_type": "code", |
| 62 | + "execution_count": null, |
| 63 | + "outputs": [], |
34 | 64 | "source": [
|
35 | 65 | "import json\n",
|
36 | 66 | "import pickle\n",
|
|
157 | 187 | "config = prepare_test_config()\n",
|
158 | 188 | "client = PolicyClient(config)\n",
|
159 | 189 | "client.launch()"
|
160 |
| - ] |
| 190 | + ], |
| 191 | + "metadata": { |
| 192 | + "collapsed": false, |
| 193 | + "pycharm": { |
| 194 | + "name": "#%%\n" |
| 195 | + } |
| 196 | + } |
161 | 197 | },
|
162 | 198 | {
|
163 | 199 | "cell_type": "code",
|
|
0 commit comments