Skip to content

Commit 4895f43

Browse files
authored
Enhance Imitation Learning Sample (#116)
* Enhance Imitation Learning Sample * Update with default values and new image * Control number of epochs * Fix forward slash
1 parent 806df6a commit 4895f43

3 files changed

Lines changed: 35 additions & 17 deletions

File tree

workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ This directory contains brief examples of workflows that can be used in combinat
5656
| Isaac Lab: Multi-Node Reinforcement Learning Training | [README](./reinforcement_learning/multi_node/README.md) |
5757
| Isaac Groot: Interactive Notebook for Inference and Fine-tuning | [README](./groot/groot_notebook/README.md) |
5858
| Isaac Groot: Finetuning a Model | [README](./groot/groot_finetune/README.md) |
59-
| Isaac Groot: Running Groot Mimic through Imitation Learning | [README](./groot/groot_mimic/README.md) |
59+
| Isaac Groot: Imitation Learning using Groot Mimic | [README](./groot/groot_mimic/README.md) |
6060
| ROS2: Running Simulation with Foxglove Visualization | [README](./ros/turtlebot/README.md) |
6161
| Gazebo: Generating Synthetic Data | [README](./synthetic_data_generation/gazebo/README.md) |
6262
| Cosmos Predict: Video2World Generation | [README](./cosmos/predict/README.md) |

workflows/groot/groot_mimic/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,23 @@ limitations under the License.
1616
SPDX-License-Identifier: Apache-2.0
1717
-->
1818

19-
# Isaac Groot: Running Groot Mimic through Imitation Learning
19+
# Isaac Groot: Imitation Learning using Groot Mimic
2020

2121
## Overview
2222

2323
This workflow allows you to generate additional robot demonstrations that can be used to train a visuomotor policy directly
2424
using [Isaac Lab](https://isaac-sim.github.io/IsaacLab/main/index.html).
25+
Afterwards, this workflow allows you to train an agent with the generated demonstrations.
2526

26-
The full tutorial from Isaac Lab can be found [here](https://isaac-sim.github.io/IsaacLab/main/source/overview/imitation-learning/augmented_imitation.html).
27+
The full tutorial from Isaac Lab can be found [here](https://isaac-sim.github.io/IsaacLab/release/2.3.0/source/overview/imitation-learning/teleop_imitation.html#generating-additional-demonstrations-with-isaac-lab-mimic).
2728

2829
## Running the Workflow
2930
```bash
3031
curl -O https://raw.githubusercontent.com/NVIDIA/OSMO/main/workflows/groot/groot_mimic/groot_mimic.yaml
3132
osmo workflow submit groot_mimic.yaml
3233
```
3334

34-
You can find the generated demonstrations through the `mimic-dataset` dataset after the workflow completes:
35+
You can find the generated demonstrations and agent checkpoints through the `mimic-dataset` dataset after the workflow completes:
3536

3637
```bash
3738
osmo dataset download mimic-dataset

workflows/groot/groot_mimic/groot_mimic.yaml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
# To submit:
1818
# osmo workflow submit groot_mimic.yaml
19+
#
20+
# To use more demonstrations:
21+
# osmo workflow submit groot_mimic.yaml --set num_envs=10 num_trials=1000
1922

2023
workflow:
2124
groups:
@@ -26,28 +29,37 @@ workflow:
2629
environment:
2730
ACCEPT_EULA: Y
2831
NO_NUCLEUS: Y
29-
OMNI_KIT_ALLOW_ROOT: '1'
30-
OMNI_SERVER: isaac-dev.ov.nvidia.com
3132
files:
32-
- contents: |2-
33-
33+
- contents: |
3434
set -euxo pipefail
35-
# Hide conflicting vulkan files, if needed
36-
if [ -e "/usr/share/vulkan" ] && [ -e "/etc/vulkan" ]; then
37-
mv /usr/share/vulkan /usr/share/vulkan_hidden
38-
fi
3935
4036
mkdir -p ./datasets
41-
curl -o ./datasets/annotated_dataset.hdf5 \
42-
https://raw.githubusercontent.com/NVIDIA-Omniverse-blueprints/synthetic-manipulation-motion-generation/main/samples/annotated_dataset.hdf5
37+
curl -o ./datasets/dataset.hdf5 \
38+
https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/IsaacLab/Mimic/franka_stack_datasets/dataset.hdf5
39+
40+
# Generating Additional Demonstrations
41+
./isaaclab.sh -p scripts/imitation_learning/isaaclab_mimic/annotate_demos.py \
42+
--device cpu --task Isaac-Stack-Cube-Franka-IK-Rel-Mimic-v0 --auto \
43+
--input_file ./datasets/dataset.hdf5 --output_file ./datasets/annotated_dataset.hdf5
4344
4445
./isaaclab.sh -p scripts/imitation_learning/isaaclab_mimic/generate_dataset.py \
45-
--device cpu --enable_cameras --headless --num_envs 1 --generation_num_trials 1 \
46+
--device cpu --enable_cameras --headless --num_envs {{ num_envs }} --generation_num_trials {{ num_trials }} \
4647
--input_file ./datasets/annotated_dataset.hdf5 --output_file {{output}}/output/mimic/mimic_dataset_1k.hdf5 \
47-
--task Isaac-Stack-Cube-Franka-IK-Rel-Blueprint-Mimic-v0
48+
--task Isaac-Stack-Cube-Franka-IK-Rel-Mimic-v0
49+
50+
apt install cmake build-essential -y
51+
./isaaclab.sh -i robomimic
52+
53+
# Training an Agent with the Generated Demonstrations
54+
./isaaclab.sh -p scripts/imitation_learning/robomimic/train.py \
55+
--task Isaac-Stack-Cube-Franka-IK-Rel-v0 --algo bc \
56+
--dataset {{output}}/output/mimic/mimic_dataset_1k.hdf5 \
57+
--epochs {{ num_epochs }}
58+
59+
cp -r logs/robomimic {{output}}/output/mimic
4860
4961
path: /tmp/entry.sh
50-
image: nvcr.io/nvidia/isaac-lab:2.2.0
62+
image: nvcr.io/nvidia/isaac-lab:2.3.0
5163
name: mimic
5264
outputs:
5365
- dataset:
@@ -60,3 +72,8 @@ workflow:
6072
gpu: 1
6173
memory: 64Gi
6274
storage: 64Gi
75+
76+
default-values:
77+
num_envs: 1
78+
num_trials: 10
79+
num_epochs: 100

0 commit comments

Comments
 (0)