isaac-sim / OmniIsaacGymEnvs

Reinforcement Learning Environments for Omniverse Isaac Gym
Other
866 stars 218 forks source link

command line argument "num_envs" is for .pth file? #113

Open yuntae96 opened 1 year ago

yuntae96 commented 1 year ago

Hi, i want to use "num_envs" argument. When i command like "PYTHON_PATH scripts/rlgames_train.py task=ShadowHand num_envs=512", i got error message below. How can i use "num_envs" argument? Thank you.

2023-11-24 03:55:10 [240,482ms] [Error] [omni.kit.app._impl] [py stderr]: Error executing job with overrides: ['task=ShadowHand', 'num_envs=512']

Error executing job with overrides: ['task=ShadowHand', 'num_envs=512'] 2023-11-24 03:55:11 [240,809ms] [Error] [omni.kit.app._impl] [py stderr]: Traceback (most recent call last):

Traceback (most recent call last): 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/OmniIsaacGymEnvs/omniisaacgymenvs/scripts/rlgames_train.py", line 142, in parse_hydra_configs rlg_trainer.run()

File "/home/bcml/OmniIsaacGymEnvs/omniisaacgymenvs/scripts/rlgames_train.py", line 142, in parse_hydra_configs rlg_trainer.run() 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/OmniIsaacGymEnvs/omniisaacgymenvs/scripts/rlgames_train.py", line 74, in run runner.run(

File "/home/bcml/OmniIsaacGymEnvs/omniisaacgymenvs/scripts/rlgames_train.py", line 74, in run runner.run( 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/torch_runner.py", line 133, in run self.run_train(args)

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/torch_runner.py", line 133, in run self.run_train(args) 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/torch_runner.py", line 113, in run_train agent = self.algo_factory.create(self.algo_name, base_name='run', params=self.params)

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/torch_runner.py", line 113, in run_train agent = self.algo_factory.create(self.algo_name, base_name='run', params=self.params) 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/common/object_factory.py", line 15, in create return builder(**kwargs)

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/common/object_factory.py", line 15, in create return builder(kwargs) 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/torch_runner.py", line 37, in self.algo_factory.register_builder('a2c_continuous', lambda kwargs : a2c_continuous.A2CAgent(**kwargs))

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/torch_runner.py", line 37, in self.algo_factory.register_builder('a2c_continuous', lambda kwargs : a2c_continuous.A2CAgent(kwargs)) 2023-11-24 03:55:11 [240,810ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/algos_torch/a2c_continuous.py", line 15, in init a2c_common.ContinuousA2CBase.init(self, base_name, params)

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/algos_torch/a2c_continuous.py", line 15, in init a2c_common.ContinuousA2CBase.init(self, base_name, params) 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/common/a2c_common.py", line 1143, in init A2CBase.init(self, base_name, params)

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/common/a2c_common.py", line 1143, in init A2CBase.init(self, base_name, params) 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/common/a2c_common.py", line 249, in init assert(self.batch_size % self.minibatch_size == 0)

File "/home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/python/lib/python3.10/site-packages/rl_games/common/a2c_common.py", line 249, in init assert(self.batch_size % self.minibatch_size == 0) 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: AssertionError

AssertionError 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: 2023-11-24 03:55:11 [240,811ms] [Error] [omni.kit.app._impl] [py stderr]: Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace. 2023-11-24 03:55:11 [240,815ms] [Warning] [carb] [Plugin: omni.spectree.delegate.plugin] Module /home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/exts/omni.usd_resolver/bin/libomni.spectree.delegate.plugin.so remained loaded after unload request 2023-11-24 03:55:11 [240,818ms] [Warning] [omni.stageupdate.plugin] Deprecated: direct use of IStageUpdate callbacks is deprecated. Use IStageUpdate::getStageUpdate instead. 2023-11-24 03:55:11 [240,822ms] [Warning] [carb.audio.context] 1 contexts were leaked 2023-11-24 03:55:11 [240,844ms] [Warning] [carb] Recursive unloadAllPlugins() detected! 2023-11-24 03:55:11 [240,862ms] [Warning] [omni.core.ITypeFactory] Module /home/bcml/.local/share/ov/pkg/isaac_sim-2023.1.0-hotfix.1/kit/exts/omni.activity.core/bin/libomni.activity.core.plugin.so remained loaded after unload request.

kellyguo11 commented 1 year ago

Hi there, you may also need to adjust the minibatch_size parameter in the PPO config file when modifying num_envs. The rl-games library requires that minibatch_size be a multiple of num_envs * horizon_length. Please see https://github.com/NVIDIA-Omniverse/OmniIsaacGymEnvs/blob/main/docs/troubleshoot.md#rl-training for more details.