isaac-sim / IsaacLab

Unified framework for robot learning built on NVIDIA Isaac Sim
https://isaac-sim.github.io/IsaacLab
Other
2.33k stars 966 forks source link

[Bug Report] Error in "Training an agent with SKRL on Isaac-Reach-Franka-v0" #123

Closed XInyuSong000 closed 1 year ago

XInyuSong000 commented 1 year ago

Describe the bug

Error in "Training an agent with SKRL on Isaac-Reach-Franka-v0"

In Orbit Documentation, I did 'Getting Started >> Running existing scripts >> Reinforcement Learning >> Training an agent with SKRL on Isaac-Reach-Franka-v0'

Steps to reproduce

[2.224s] Simulation App Startup Complete Traceback (most recent call last): File "source/standalone/workflows/skrl/train.py", line 49, in from skrl.agents.torch.ppo import PPO, PPO_DEFAULT_CONFIG File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/skrl/agents/torch/init.py", line 1, in from skrl.agents.torch.base import Agent File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/skrl/agents/torch/base.py", line 4, in import gym, gymnasium File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/gymnasium/init.py", line 12, in from gymnasium.envs.registration import ( File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/gymnasium/envs/init.py", line 382, in load_plugin_envs() File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/gymnasium/envs/registration.py", line 565, in load_plugin_envs for plugin in metadata.entry_points(group=entry_point): TypeError: entry_points() got an unexpected keyword argument 'group'

System Info

Describe the characteristic of your environment:

Additional context

Add any other context about the problem here.

Checklist

Mayankm96 commented 1 year ago

Which version of skrl did you install?

XInyuSong000 commented 1 year ago

Which version of skrl did you install?

I attempted to use skrl-v1.0.0 and skrl-v0.10.2 however, I encountered the same error in both versions.

Mayankm96 commented 1 year ago

Is it possible to use a version lower than that? I think @Toni-SM made a PR back then, which we tested on 10.1. Probably some breaking changes have happened since.

He also opened another MR #109 that may have the fix you need.

Currently, we are working on the next version release from our internal branch so haven't gotten around to merging it in yet.

Toni-SM commented 1 year ago

Hi @XInyuSong000

According to the logs, the problem seems to be related to gymnasium. Which version of gymnasium do you have installed?

XInyuSong000 commented 1 year ago

Hi @XInyuSong000

According to the logs, the problem seems to be related to gymnasium. Which version of gymnasium do you have installed?

I have installed version 0.28.1 of gymnasium.

XInyuSong000 commented 1 year ago

Is it possible to use a version lower than that? I think @Toni-SM made a PR back then, which we tested on 10.1. Probably some breaking changes have happened since.

He also opened another MR #109 that may have the fix you need.

Currently, we are working on the next version release from our internal branch so haven't gotten around to merging it in yet.

I have tested SKRL version 0.10.1, but the error persists.

Toni-SM commented 1 year ago

Hi @XInyuSong000

Please, check this post: https://github.com/Farama-Foundation/Gymnasium/issues/442

XInyuSong000 commented 1 year ago

Hi @XInyuSong000

Please, check this post: Farama-Foundation/Gymnasium#442

Hi, I have checked the post. I ran the command "pip install --upgrade importlib_metadata", but then I encountered a new error:

Traceback (most recent call last): File "source/standalone/workflows/skrl/train.py", line 46, in import gym File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/gym/init.py", line 13, in from gym.envs import make, spec, register File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/gym/envs/init.py", line 10, in _load_env_plugins() File "/home/bajibaji/miniconda3/envs/orbit/lib/python3.7/site-packages/gym/envs/registration.py", line 250, in load_env_plugins for plugin in metadata.entry_points().get(entry_point, []): AttributeError: 'EntryPoints' object has no attribute 'get'

Toni-SM commented 1 year ago

Hi @XInyuSong000

Which version of gym do you have installed?

XInyuSong000 commented 1 year ago

Hi @XInyuSong000

Which version of gym do you have installed?

I have installed version: 0.21.0

Toni-SM commented 1 year ago

Hi @XInyuSong000

Mmmmmmmm, I can run Isaac Orbit's skrl examples without any problem with the following package versions:

toni@HP-ZBook-Studio-G8:~/isaacorbit/Orbit$ orbit -p -m pip show gym gymnasium importlib_metadata
[INFO] Using python from: /home/toni/.local/share/ov/pkg/isaac_sim-2022.2.1/python.sh                                                                                                                       
Name: gym
Version: 0.21.0
Summary: Gym: A universal API for reinforcement learning environments.
Home-page: https://github.com/openai/gym
Author: OpenAI
Author-email: jkterry@umd.edu
License: 
Location: /home/toni/.local/share/ov/pkg/isaac_sim-2022.2.1/kit/python/lib/python3.7/site-packages
Requires: cloudpickle, importlib-metadata, numpy
Required-by: omni-isaac-orbit-envs, rl-games, skrl, stable-baselines3
---
Name: gymnasium
Version: 0.28.1
Summary: A standard API for reinforcement learning and a diverse set of reference environments (formerly Gym).
Home-page: 
Author: 
Author-email: Farama Foundation <contact@farama.org>
License: MIT License
Location: /home/toni/.local/share/ov/pkg/isaac_sim-2022.2.1/kit/python/lib/python3.7/site-packages
Requires: cloudpickle, farama-notifications, importlib-metadata, jax-jumpy, numpy, typing-extensions
Required-by: skrl
---
Name: importlib-metadata
Version: 4.13.0
Summary: Read metadata from Python packages
Home-page: https://github.com/python/importlib_metadata
Author: Jason R. Coombs
Author-email: jaraco@jaraco.com
License: 
Location: /home/toni/.local/share/ov/pkg/isaac_sim-2022.2.1/kit/python/lib/python3.7/site-packages
Requires: typing-extensions, zipp
Required-by: gym, gymnasium, huggingface-hub, jsonschema, Markdown, omni-isaac-orbit-envs, Pint, pluggy, pre-commit, prettytable, pytest, stable-baselines3, virtualenv

Can you please, run the examples without conda?