ACG icon indicating copy to clipboard operation
ACG copied to clipboard

All task success rates are 0% after fine-tuning on DexMimicGen data

Open SII-ZhangYiFei opened this issue 8 months ago • 2 comments

Hi, thanks for releasing this great work!

I’m trying to finetune GR00T-N1-2B on the MimicGen DexMG dataset, but I’m getting 0% success rate across all evaluation tasks. I might be misunderstanding something in the setup, so I’d really appreciate any guidance.

Environment

Base model: GR00T-N1-2B GPUs: 1×H100 Simulation: DexMG Dataset: https://huggingface.co/datasets/MimicGen/dexmimicgen_datasets/tree/main/generated

Finetune Script

n_mg="300"
export DEXMG_VIDEO_RESOLUTION="84x84"   # fast decoding, lower resolution
note="_${DEXMG_VIDEO_RESOLUTION}"

source /path/to/anaconda3/etc/profile.d/conda.sh
conda activate acg

# === Experiment setup ===
steps="60000"
ngpu="1"
bs="64"
ga="2"
training_seed="42"
exp_name="MG${n_mg}/LR=1e-4_Bs=${ngpu}x${bs}x${ga}_Steps=${steps}_Seed=${training_seed}${note}"

# === Logging (Weights & Biases) ===
export WANDB_MODE=offline
# export WANDB_ENTITY="your-entity"
# export WANDB_PROJECT="Your Robot Project"

# === Launch training ===
python libs/Isaac-GR00T-N1/scripts/gr00t_finetune_robocasa.py \
  --num-gpus ${ngpu} \
  --output-dir checkpoints/dexmg/${exp_name} \
  --data-configs dexmg_bimanual_panda_gripper dexmg_bimanual_panda_hand dexmg_gr1_arms_only dexmg_gr1_arms_only \
  --video-backend decord \
  --embodiment_tag single_panda_gripper \
  --exp_name ${exp_name} \
  --batch_size ${bs} \
  --robomimic_config_json libs/Isaac-GR00T-N1/robomimic_configs/dexmg_mg${n_mg}.json \
  --gradient_accumulation_steps ${ga} \
  --no-save-only-model \
  --dataloader_num_workers 16 \
  --max-steps ${steps} \
  --save_steps 1000 \
  --save_total_limit 3 \
  --dataset_cls=dexmg \
  --pin_memory \
  --training_seed ${training_seed} \
  --base_model_path /path/to/GR00T-N1-2B

Config json file

i only modified the train.data section

{
  "algo_name": "gr00t",
  "experiment": {
    "name": "test_ds_two_arm_box_cleanup_D0_seed_201",
    "validate": false,
    "logging": {
      "terminal_output_to_txt": true,
      "log_tb": true,
      "log_wandb": false,
      "wandb_proj_name": "debug"
    },
    "mse": {},
    "save": {
      "enabled": true,
      "every_n_seconds": null,
      "every_n_epochs": 100,
      "epochs": [],
      "on_best_validation": false,
      "on_best_rollout_return": false,
      "on_best_rollout_success_rate": true
    },
    "epoch_every_n_steps": 500,
    "validation_epoch_every_n_steps": 50,
    "env": null,
    "additional_envs": null,
    "render": false,
    "render_video": true,
    "keep_all_videos": false,
    "video_skip": 5,
    "rollout": {
      "enabled": true,
      "n": 50,
      "horizon": 400,
      "rate": 100,
      "warmstart": -1,
      "terminate_on_success": true,
      "batched": true,
      "num_batch_envs": 25
    },
    "env_meta_update_dict": {
      "env_kwargs": {
        "camera_heights": 160,
        "camera_widths": 256
      }
    }
  },
  "train": {
    "data_format": "dexmg",
    "data": [
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_threading.hdf5",
        "horizon": 400,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "pick the thread and insert it into the ring"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_three_piece_assembly.hdf5",
        "horizon": 300,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "assemble the three pieces to form a block"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_transport.hdf5",
        "horizon": 1200,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "move the red block to the other side, and move the hammer to the block's original position"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_box_cleanup.hdf5",
        "horizon": 400,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "move the box lid onto the box"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_drawer_cleanup.hdf5",
        "horizon": 550,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "pick the cup and open the drawer, then put the cup in the drawer and close the drawer"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_lift_tray.hdf5",
        "horizon": 750,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "put the two objects in the tray and then lift the tray"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_can_sort_random.hdf5",
        "horizon": 400,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "pick the can and put it in the box"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_pouring.hdf5",
        "horizon": 400,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "pick the cup and open the drawer, then put the cup in the drawer and close the drawer"
      },
      {
        "path": "/path/to/ACG/DexmgDataset/two_arm_coffee.hdf5",
        "horizon": 400,
        "do_eval": true,
        "filter_key": "/path/to/ACG/DexmgDataset/splits/300_demos.json",
        "lang": "insert the coffee pod into the coffee machine and close the lid"
      }
    ],
    "output_dir": "outputs",
    "num_data_workers": 4,
    "hdf5_cache_mode": "low_dim",
    "hdf5_use_swmr": true,
    "hdf5_load_next_obs": false,
    "hdf5_normalize_obs": false,
    "hdf5_filter_key": null,
    "hdf5_validation_filter_key": null,
    "seq_length": 16,
    "pad_seq_length": true,
    "frame_stack": 1,
    "pad_frame_stack": true,
    "dataset_keys": ["actions"],
    "goal_mode": null,
    "cuda": true,
    "batch_size": 16,
    "num_epochs": 600,
    "seed": 201,
    "action_keys": ["actions"],
    "action_config": {
      "actions": {
        "normalization": null
      },
      "action_dict/right_rel_pos": {
        "normalization": null
      },
      "action_dict/right_rel_rot_axis_angle": {
        "normalization": null,
        "format": "rot_axis_angle"
      },
      "action_dict/right_gripper": {
        "normalization": "min_max"
      },
      "action_dict/left_rel_pos": {
        "normalization": null
      },
      "action_dict/left_rel_rot_axis_angle": {
        "normalization": null,
        "format": "rot_axis_angle"
      },
      "action_dict/left_gripper": {
        "normalization": "min_max"
      },
      "action_dict/right_abs_pos": {
        "normalization": "min_max"
      },
      "action_dict/right_abs_rot_6d": {
        "normalization": null,
        "format": "rot_6d"
      },
      "action_dict/left_abs_pos": {
        "normalization": "min_max"
      },
      "action_dict/left_abs_rot_6d": {
        "normalization": null,
        "format": "rot_6d"
      }
    }
  },
  "algo": {
    "model_path": "nvidia/GR00T-N1-2B",
    "metadata_path": "metadatas/robocasa_single_panda_gripper.json",
    "data_config": "robocasa_single_panda_gripper",
    "embodiment_tag": "single_panda_gripper",
    "optim_params": {
      "model": {
        "learning_rate": {
          "initial": 1e-4,
          "scheduler_type": "cosine",
          "num_warmup_steps": 1000
        },
        "optimizer_type": "adamw",
        "regularization": {
          "L2": 1e-5
        },
        "optimizer_kwargs": {
          "betas": [0.95, 0.999],
          "eps": 1e-8
        }
      }
    }
  },
  "observation": {
    "modalities": {
      "obs": {
        "low_dim": [
          "robot0_eef_pos",
          "robot0_eef_quat",
          "robot0_gripper_qpos",
          "robot1_eef_pos",
          "robot1_eef_quat",
          "robot1_gripper_qpos",
          "robot0_right_eef_pos",
          "robot0_right_eef_quat",
          "robot0_right_gripper_qpos",
          "robot0_left_eef_pos",
          "robot0_left_eef_quat",
          "robot0_left_gripper_qpos"
        ],
        "rgb": [
          "agentview_image",
          "robot0_eye_in_hand_image",
          "robot1_eye_in_hand_image",
          "shouldercamera0_image",
          "shouldercamera1_image",
          "frontview_image"
        ],
        "depth": [],
        "scan": []
      },
      "goal": {
        "low_dim": [],
        "rgb": [],
        "depth": [],
        "scan": []
      }
    },
    "encoder": {
      "low_dim": {
        "core_class": null,
        "core_kwargs": {},
        "obs_randomizer_class": null,
        "obs_randomizer_kwargs": {}
      },
      "rgb": {
        "core_class": "VisualCore",
        "core_kwargs": {
          "feature_dimension": 64,
          "flatten": true,
          "backbone_class": "ResNet18Conv",
          "backbone_kwargs": {
            "pretrained": false,
            "input_coord_conv": false
          },
          "pool_class": "SpatialSoftmax",
          "pool_kwargs": {
            "num_kp": 32,
            "learnable_temperature": false,
            "temperature": 1.0,
            "noise_std": 0.0,
            "output_variance": false
          }
        },
        "obs_randomizer_class": "CropRandomizer",
        "obs_randomizer_kwargs": {
          "crop_height": 224,
          "crop_width": 224,
          "num_crops": 1,
          "pos_enc": false
        }
      },
      "depth": {
        "core_class": "VisualCore",
        "core_kwargs": {},
        "obs_randomizer_class": null,
        "obs_randomizer_kwargs": {}
      },
      "scan": {
        "core_class": "ScanCore",
        "core_kwargs": {},
        "obs_randomizer_class": null,
        "obs_randomizer_kwargs": {}
      }
    }
  },
  "meta": {
    "hp_base_config_file": "",
    "hp_keys": ["ds", "seed"],
    "hp_values": ["two_arm_box_cleanup_D0", 201]
  }
}

Rollout Script

export MUJOCO_GL=osmesa
cd /path/to/ACG
source /path/to/anaconda3/etc/profile.d/conda.sh
conda activate acg

note=""
n_rollouts="25"
num_batch_envs="8"
export MAX_NUM_EMBODIMENTS="35"
dataset_name="dexmg_mg300"
config_path="libs/Isaac-GR00T-N1/robomimic_configs/${dataset_name}.json"
model_path="checkpoints/dexmg/MG300/LR=1e-4_Bs=1x64x2_Steps=60000_Seed=42_84x84"
seed="123"

bash scripts/base_rollout.sh ${config_path} ${model_path} ${seed} ${n_rollouts} ${num_batch_envs} "${note}" algo_name=gr00t_guidance_dexmg

Result

{"env": "TwoArmThreading", "Return": 0.0, "Horizon": 400.0, "Success_Rate": 0.0, "time": 16.68054635822773, "Time_Episode": 8.89629139105479}
{"env": "TwoArmThreePieceAssembly", "Return": 0.0, "Horizon": 300.0, "Success_Rate": 0.0, "time": 14.17468936741352, "Time_Episode": 7.559834329287211}
{"env": "TwoArmTransport", "Return": 0.0, "Horizon": 1200.0, "Success_Rate": 0.0, "time": 92.65000289678574, "Time_Episode": 49.413334878285724}
{"env": "TwoArmBoxCleanup", "Return": 0.0, "Horizon": 400.0, "Success_Rate": 0.0, "time": 29.66406761854887, "Time_Episode": 15.820836063226064}
{"env": "TwoArmDrawerCleanup", "Return": 0.0, "Horizon": 550.0, "Success_Rate": 0.0, "time": 34.93545889854431, "Time_Episode": 18.6322447458903}
{"env": "TwoArmLiftTray", "Return": 0.0, "Horizon": 750.0, "Success_Rate": 0.0, "time": 53.138619497418404, "Time_Episode": 28.340597065289817}
{"env": "TwoArmCanSortRandom", "Return": 0.0, "Horizon": 400.0, "Success_Rate": 0.0, "time": 19.6170237287879, "Time_Episode": 10.462412655353546}
{"env": "TwoArmPouring", "Return": 0.0, "Horizon": 400.0, "Success_Rate": 0.0, "time": 21.283864617347717, "Time_Episode": 11.35139446258545}
{"env": "TwoArmCoffee", "Return": 0.0, "Horizon": 400.0, "Success_Rate": 0.0, "time": 22.831389136612415, "Time_Episode": 12.176740872859956}

Question

  1. Is there a bug in my fine-tuning or rollout script? Am i misunderstanding any thing in https://github.com/DAVIAN-Robotics/ACG/blob/main/scripts/Training_Rollout_Guideline.md?
  2. Is the dataset from HuggingFace (https://huggingface.co/datasets/MimicGen/dexmimicgen_datasets/tree/main/generated) the same one used for the reported results in the repo?

SII-ZhangYiFei avatar Mar 27 '26 10:03 SII-ZhangYiFei

Hi, thank you for your interest.

I'm not entirely sure based on the given information, but could you check the base_model_path? (--base_model_path /path/to/GR00T-N1-2B) Without loading the pretrained model, performance tends to be very limited.

Also, could you try running the rollout scripts with my pretrained model to see if the issue persists?

Best, Minho

pmh9960 avatar Mar 31 '26 05:03 pmh9960

Hi Minho,

Thanks for your reply!

I’ve identified the main issue causing the 0% success rate. It turns out it was due to using a low video resolution (84×84). After preprocessing to a higher resolution(256×256), the performance is no longer zero, and is very close to the checkpoint you released.

While debugging, I also noticed a potential issue related to the dataset and rollout setup: In libs/Isaac-GR00T-N1/scripts/rollout_with_robomimic.py (lines 74–75), there is a hardcoded patch:

        if env_meta['env_name'] == 'TwoArmCanSortBlue':  # ! todo hard coding, the dataset file is wrong
            deep_update(env_meta, {'env_name': 'TwoArmCanSortRandom', 'env_kwargs': {'camera_names': ['agentview', 'robot0_eye_in_right_hand', 'robot0_eye_in_left_hand']}})

and in https://github.com/DAVIAN-Robotics/ACG/blob/main/scripts/Training_Rollout_Guideline.md, you use

task_name="two_arm_can_sort_random"         ; render_image_name="agentview"             ; python scripts/playback_datasets_save_videos.py --dataset ${DATASET_ROOT}/dexmimicgen/generated/${task_name}.hdf5 --video_skip 1 --video_dir ${DATASET_ROOT}/dexmimicgen/generated/videos/${task_name}/obs/${render_image_name}_image --n 1000 --render_image_names ${render_image_name}

to preprocess the data for two_arm_can_sort_random task However, the original DexMimicGen dataset appears to use frontview instead:

>>> file['data']['demo_1']['obs'].keys()
<KeysViewHDF5 ['frontview_image', 'robot0_base_pos', 'robot0_base_quat', 'robot0_base_to_left_eef_pos', 'robot0_base_to_left_eef_quat', 'robot0_base_to_left_eef_quat_site', 'robot0_base_to_right_eef_pos', 'robot0_base_to_right_eef_quat', 'robot0_base_to_right_eef_quat_site', 'robot0_eye_in_left_hand_image', 'robot0_eye_in_right_hand_image', 'robot0_joint_pos', 'robot0_joint_pos_cos', 'robot0_joint_pos_sin', 'robot0_joint_vel', 'robot0_left_eef_pos', 'robot0_left_eef_quat', 'robot0_left_eef_quat_site', 'robot0_left_gripper_qpos', 'robot0_left_gripper_qvel', 'robot0_right_eef_pos', 'robot0_right_eef_quat', 'robot0_right_eef_quat_site', 'robot0_right_gripper_qpos', 'robot0_right_gripper_qvel']>

This mismatch isn’t mentioned in the README or docs, and it can silently lead to poor performance if not noticed. Might be worth adding a note or clarification for this.

Best, YiFei

SII-ZhangYiFei avatar Apr 05 '26 09:04 SII-ZhangYiFei