bazaar-research's picture
Upload folder using huggingface_hub
fb11af9 verified

2. Construct Custom Dataset

The assets/norm_stats/robotwin_5_customized.json generated in the previous step stores your normalization statistics. To use this file:

  1. Specify the path in your Run Command via: --data.norm_stats_file assets/norm_stats/robotwin_5_customized.json.
  2. Replace the Dataset Class: In tasks/vla/train_lingbotvla.py, replace the default RobotwinDataset with the provided CustomizedRobotwinDataset.

Implementation Details:

When constructing a custom dataset similar to CustomizedRobotwinDataset, ensure the following:

  • Key Mapping: When instantiating self.normalizer and obtaining normalized_item, you must modify the original keys for actions, states, and images from all views. For RoboTwin 2.0, the keys are:
    • Action: 'action'
    • State: 'observation.state'
    • Images: 'observation.images.cam_high', 'observation.images.cam_left_wrist', 'observation.images.cam_right_wrist'
  • Data Type: When instantiating self.normalizer, set the parameter data_type='customized'.

3. Deployment

To ensure correct results, the data processing logic during the testing phase must be identical to the training phase.

Taking deploy/lingbot_robotwin_policy.py as an example: You should use the same action, state, and image keys as in the training phase.
Also, when constructing policy.normalizer in line 323, make sure the attribute data_type is consistent with your training setup.

For example, if you used CustomizedRobotwinDataset during training,
then line 323 in deploy/lingbot_robotwin_policy.py should be data_type='customized'.