Cannot change num_envs in Omniverse Isaac Gym examples. Only default value works

Hello,

When I try to run examples into train at OmniIsaacGymEnvs with not default num_envs, I cannot run the examples.

I tried several ways for example,

  • added arguments on the terminal
  • changed num_envs at config.yaml
  • changed a value at each task’s yaml files

The error message is like below.

Started to train
Exact experiment name requested from command line: FrankaCabinet
Box([-1. -1. -1. -1. -1. -1. -1. -1. -1.], [1. 1. 1. 1. 1. 1. 1. 1. 1.], (9,), float32) Box([-inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf -inf
 -inf -inf -inf -inf -inf -inf -inf -inf -inf], [inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf inf
 inf inf inf inf inf], (23,), float32)
current training device: cuda:0
Error executing job with overrides: ['task=FrankaCabinet', 'num_envs=2']
Traceback (most recent call last):
  File "OmniIsaacGymEnvs/omniisaacgymenvs/scripts/rlgames_train.py", line 131, in parse_hydra_configs
    rlg_trainer.run()
  File "OmniIsaacGymEnvs/omniisaacgymenvs/scripts/rlgames_train.py", line 83, in run
    'sigma': None
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/torch_runner.py", line 120, in run
    self.run_train(args)
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/torch_runner.py", line 98, in run_train
    agent = self.algo_factory.create(self.algo_name, base_name='run', params=self.params)
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/common/object_factory.py", line 15, in create
    return builder(**kwargs)
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/torch_runner.py", line 39, in <lambda>
    self.algo_factory.register_builder('a2c_continuous', lambda **kwargs : a2c_continuous.A2CAgent(**kwargs))
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/algos_torch/a2c_continuous.py", line 16, in __init__
    a2c_common.ContinuousA2CBase.__init__(self, base_name, params)
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/common/a2c_common.py", line 999, in __init__
    A2CBase.__init__(self, base_name, params)
  File "/home/bak/anaconda3/envs/tool-manipulation/lib/python3.7/site-packages/rl_games/common/a2c_common.py", line 192, in __init__
    assert(self.batch_size % self.minibatch_size == 0)
AssertionError

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
Segmentation fault (core dumped)

Should I have to change it in another way?

Thanks.

1 Like

I can run the code when I reduce the minibatch size.

In the example, the minibatch_size was 8192 which is a double of num_envs. So, when I change it to 4 with num_envs=2.

How can I set the minibatch_size and num_envs in an appropriate way?

Hi @psh9002

Please, check the RL Training section in OmniIsaacGymEnvs documentation

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.