|
8 | 8 | "source": [ |
9 | 9 | "# Run this cell only when you are troubled with the following error especially if you are using conda to manage python environment\n", |
10 | 10 | "# `ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory\n", |
| 11 | + "import os\n", |
| 12 | + "from pathlib import Path\n", |
11 | 13 | "from ctypes import cdll\n", |
12 | | - "lib1 = cdll.LoadLibrary('YOUR_CONDA_PATH/envs/YOUR_CONDA_ENV_NAME/lib/libpython3.8.so.1.0')\n" |
| 14 | + "import sys\n", |
| 15 | + "is_conda = 'CONDA_PREFIX' in os.environ or 'CONDA_DEFAULT_ENV' in os.environ\n", |
| 16 | + "if is_conda:\n", |
| 17 | + " version_info = sys.version_info\n", |
| 18 | + " conda_lib_path = Path(sys.executable).parent.parent / f\"lib/libpython{version_info.major}.{version_info.minor}.so.1.0\"\n", |
| 19 | + " python_lib = cdll.LoadLibrary(str(conda_lib_path))\n", |
| 20 | + " print(f\"Load Python lib {conda_lib_path}\")\n" |
13 | 21 | ] |
14 | 22 | }, |
15 | 23 | { |
|
19 | 27 | "outputs": [], |
20 | 28 | "source": [ |
21 | 29 | "import os\n", |
22 | | - "import sys\n", |
23 | 30 | "from datetime import datetime\n", |
24 | 31 | "import numpy as np\n", |
25 | 32 | "\n", |
|
73 | 80 | "vec_task.VecTask.create_sim = wrapped_create_sim\n", |
74 | 81 | "\n", |
75 | 82 | "# Create web visualizer\n", |
76 | | - "web_visualizer = create_isaac_visualizer(port=6000, host=\"localhost\", keep_default_viewer=False, max_env=4, scene_offset=np.array([10.0, 10.0]))\n", |
| 83 | + "web_visualizer = create_isaac_visualizer(port=6000, host=\"localhost\", keep_default_viewer=False, max_env=16, scene_offset=np.array([40.0, 40.0]))\n", |
77 | 84 | "\n", |
78 | 85 | "\n", |
79 | 86 | "################################################################################################\n", |
|
264 | 271 | { |
265 | 272 | "cell_type": "code", |
266 | 273 | "execution_count": null, |
267 | | - "metadata": {}, |
| 274 | + "metadata": { |
| 275 | + "collapsed": false, |
| 276 | + "jupyter": { |
| 277 | + "outputs_hidden": false |
| 278 | + } |
| 279 | + }, |
268 | 280 | "outputs": [], |
269 | 281 | "source": [ |
270 | | - "# Modify the IP if the jupyter server is not localhost\n", |
271 | | - "machine_ip = \"127.0.0.1\"\n", |
272 | | - "web_visualizer.jupyter_cell(url=f\"http://{machine_ip}:7000/static/\")" |
| 282 | + "# Comment out the hydra/job_logging in the config to avoid a hydra error.\n", |
| 283 | + "# This is nothing related to the web visualizer but will raise a multiple value error without the following modification\n", |
| 284 | + "# You do not need to do that if you are not using hydra compose API.\n", |
| 285 | + "!sed -i 's/- hydra/#- hydra/g' IsaacGymEnvs/isaacgymenvs/cfg/config.yaml" |
273 | 286 | ] |
274 | 287 | }, |
275 | 288 | { |
276 | 289 | "cell_type": "code", |
277 | 290 | "execution_count": null, |
| 291 | + "metadata": {}, |
278 | 292 | "outputs": [], |
279 | 293 | "source": [ |
280 | | - "# Comment out the hydra/job_logging in the config to avoid a hydra error.\n", |
281 | | - "# This is nothing related to the web visualizer but will raise a multiple value error without the following modification\n", |
282 | | - "# You do not need to do that if you are not using hydra compose API.\n", |
283 | | - "!sed -i 's/- hydra/#- hydra/g' IsaacGymEnvs/isaacgymenvs/cfg/config.yaml" |
284 | | - ], |
285 | | - "metadata": { |
286 | | - "collapsed": false |
287 | | - } |
| 294 | + "# Modify the IP if the jupyter server is not localhost\n", |
| 295 | + "machine_ip = \"127.0.0.1\"\n", |
| 296 | + "web_visualizer.jupyter_cell(url=f\"http://{machine_ip}:7000/static/\", height=400)" |
| 297 | + ] |
288 | 298 | }, |
289 | 299 | { |
290 | 300 | "cell_type": "code", |
291 | 301 | "execution_count": null, |
292 | | - "metadata": {}, |
| 302 | + "metadata": { |
| 303 | + "scrolled": true |
| 304 | + }, |
293 | 305 | "outputs": [], |
294 | 306 | "source": [ |
295 | 307 | "hydra.core.global_hydra.GlobalHydra.instance().clear()\n", |
296 | 308 | "config_path = \"IsaacGymEnvs/isaacgymenvs/cfg\"\n", |
297 | | - "\n", |
298 | | - "task_name = \"AllegroHand\"\n", |
| 309 | + "task_name = \"Ant\"\n", |
299 | 310 | "with hydra.initialize(version_base=None, config_path=config_path):\n", |
300 | 311 | " cfg = hydra.compose(config_name='config.yaml', overrides=[f\"task={task_name}\"])\n", |
301 | | - "\n", |
302 | | - "launch_rlg_hydra(cfg)\n" |
| 312 | + "launch_rlg_hydra(cfg)" |
303 | 313 | ] |
304 | 314 | }, |
305 | 315 | { |
|
326 | 336 | "name": "python", |
327 | 337 | "nbconvert_exporter": "python", |
328 | 338 | "pygments_lexer": "ipython3", |
329 | | - "version": "3.8.16" |
| 339 | + "version": "3.8.17" |
330 | 340 | } |
331 | 341 | }, |
332 | 342 | "nbformat": 4, |
333 | | - "nbformat_minor": 1 |
| 343 | + "nbformat_minor": 4 |
334 | 344 | } |
0 commit comments