leap-hand / LEAP_Hand_Sim

http://leaphand.com/
MIT License
94 stars 16 forks source link

Problem generating my own cache #4

Closed wredsen closed 1 year ago

wredsen commented 1 year ago

When I try to run the mentioned code to generate a cache of stable grasps for different cube sizes:

for cube_scale in 0.9 0.95 1.0 1.05 1.1 
do
    bash scripts/gen_grasp.sh $cube_scale custom_grasp_cache num_envs=1024 
done

I face the following error:

[Warning] [carb.gym.plugin] useGpu is set, forcing single scene (0 subscenes)
Not connected to PVD
+++ Using GPU PhysX
Physics Engine: PhysX
Physics Device: cuda:0
GPU Pipeline: disabled
{'observation_space': Box(-inf, inf, (102,), float32), 'action_space': Box(-1.0, 1.0, (16,), float32), 'agents': 1, 'value_size': 1}
build mlp: 256
RunningMeanStd:  (1,)
RunningMeanStd:  (102,)
Error executing job with overrides: ['task=LeapHandGrasp', 'task.env.baseObjScale=0.9', 'task.env.grasp_cache_name=custom_grasp_cache', 'test=true', 'pipeline=cpu', 'test=true', 'train.params.config.player.games_num=10000000000000000', 'task.env.episodeLength=50', 'num_envs=128']
Traceback (most recent call last):
  File "train.py", line 164, in launch_rlg_hydra
    runner.run({
  File "/home/kwrede/anaconda3/envs/leapsim/lib/python3.8/site-packages/rl_games/torch_runner.py", line 123, in run
    self.run_play(args)
  File "/home/kwrede/anaconda3/envs/leapsim/lib/python3.8/site-packages/rl_games/torch_runner.py", line 108, in run_play
    player.run()
  File "/home/kwrede/anaconda3/envs/leapsim/lib/python3.8/site-packages/rl_games/common/player.py", line 189, in run
    obses = self.env_reset(self.env)
  File "/home/kwrede/anaconda3/envs/leapsim/lib/python3.8/site-packages/rl_games/common/player.py", line 127, in env_reset
    obs = env.reset()
  File "/home/kwrede/easscratch/Omniverse/LEAP_Hand_Sim/leapsim/tasks/leap_hand_rot.py", line 815, in reset
    super().reset()
  File "/home/kwrede/easscratch/Omniverse/LEAP_Hand_Sim/leapsim/tasks/base/vec_task.py", line 328, in reset
    self.reset_idx(env_ids)
  File "/home/kwrede/easscratch/Omniverse/LEAP_Hand_Sim/leapsim/tasks/leap_hand_grasp.py", line 59, in reset_idx
    self._update_priv_buf(env_id=env_id, name='obj_mass', value=prop[0].mass, lower=0, upper=0.2)
AttributeError: 'LeapHandGrasp' object has no attribute '_update_priv_buf'

Using the provided Cache and start training the policy from there seems to work, while still taking a long time. Would you consider about 14 hours ok for max_iterations=10000 (Running this on a RTX 4080)?

anag004 commented 1 year ago

_update_priv_buf is an old function that is not used anymore, I have removed it from leap_hand_grasp.py in the latest commit. You can pull and re-run the cache generation, it should work now.

Using the provided Cache and start training the policy from there seems to work, while still taking a long time. Would you consider about 14 hours ok for max_iterations=10000 (Running this on a RTX 4080)?

You don't need to run for 10k iterations, only until convergence. Roughly 1k iterations should be more than enough. I have updated this in the README as well :)