AnthonyHuo / SDP

SDP
MIT License
23 stars 2 forks source link

Error in call to target 'diffusion_policy.env_runner.robomimic_image_runner.RobomimicImageRunner': #2

Closed deng-cy20 closed 3 weeks ago

deng-cy20 commented 3 weeks ago

Hi, while trying to reproduce your work, I encountered the error below:

File "/home/deng-cy20/DCY/year1/SDP/train.py", line 34, in main
    workspace.run()
  File "/home/deng-cy20/DCY/year1/SDP/diffusion_policy/workspace/train_diffusion_transformer_hybrid_workspace.py", line 128, in run
    env_runners.append(hydra.utils.instantiate(cfg[f'task{i}'].env_runner, output_dir=self.output_dir))
  File "/home/deng-cy20/anaconda3/envs/sdp/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 222, in instantiate
    return instantiate_node(
  File "/home/deng-cy20/anaconda3/envs/sdp/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 339, in instantiate_node
    return _call_target(_target_, partial, args, kwargs, full_key)
  File "/home/deng-cy20/anaconda3/envs/sdp/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 97, in _call_target
    raise InstantiationException(msg) from e
hydra.errors.InstantiationException: Error in call to target 'diffusion_policy.env_runner.robomimic_image_runner.RobomimicImageRunner':
Exception('Environment Square_D0 not found. Make sure it is a registered environment among: Lift, Stack, NutAssembly, NutAssemblySingle, NutAssemblySquare, NutAssemblyRound, PickPlace, PickPlaceSingle, PickPlaceMilk, PickPlaceBread, PickPlaceCereal, PickPlaceCan, Door, Wipe, ToolHang, TwoArmLift, TwoArmPegInHole, TwoArmHandover, TwoArmTransport')
full_key: task0.env_runner

I guess this might be relevant to robosuite. Do you have any clue what's going on? Thanks!

deng-cy20 commented 3 weeks ago

To create synchronized environments, create_env function in robomimic_image_runner.py is called. Then to create env, EnvUtils.create_env_from_metadata() is called and env_meta is

{'env_name': 'Square_D0', 'env_version': '1.4.1', 'type': 1, 'env_kwargs': {'has_renderer': False, 'has_offscreen_renderer': True, 'ignore_done': True, 'use_object_obs': False, 'use_camera_obs': True, 'control_freq': 20, 'controller_configs': {'type': 'OSC_POSE', 'input_max': 1, 'input_min': -1, 'output_max': [0.05, 0.05, 0.05, 0.5, 0.5, 0.5], 'output_min': [-0.05, -0.05, -0.05, -0.5, -0.5, -0.5], 'kp': 150, 'damping': 1, 'impedance_mode': 'fixed', 'kp_limits': [0, 300], 'damping_limits': [0, 10], 'position_limits': None, 'orientation_limits': None, 'uncouple_pos_ori': True, 'control_delta': True, 'interpolation': None, 'ramp_ratio': 0.2}, 'robots': ['Panda'], 'camera_depths': False, 'camera_heights': 84, 'camera_widths': 84, 'render_gpu_device_id': 0, 'reward_shaping': False, 'camera_names': ['agentview', 'robot0_eye_in_hand']}}

Type 1 indicates that its env class should be EnvRobosuite. Square_D0 should be a task in mimicgen and it does not implemented in the original version of robosuite. I think that's the reason why the error occurs.

WuTanKun commented 1 week ago

@deng-cy20 Hi!I meet the same problem. Can you tell me how to solve that? Thanks a lot!

WuTanKun commented 1 week ago

https://github.com/NVlabs/mimicgen/issues/18 shows the way to handle this problem.