Repository navigation
Adds support for validating replay success using the task’s termination success. - #4170
Conversation
…environment termination criteria
Greptile OverviewGreptile SummaryThis PR adds support for validating replay success rate using the task's termination criteria in the Key Changes:
Issues Found:
Confidence Score: 2/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant replay_demos.py
participant env_cfg
participant Environment
participant success_term
User->>replay_demos.py: Run with --validate_success_rate
replay_demos.py->>env_cfg: parse_env_cfg()
replay_demos.py->>env_cfg: Extract success termination
env_cfg-->>replay_demos.py: success_term
replay_demos.py->>Environment: Create environment
loop For each episode
replay_demos.py->>Environment: Load episode & replay actions
Environment-->>replay_demos.py: Episode complete
replay_demos.py->>success_term: Check success_term.func(env)
success_term-->>replay_demos.py: Success/Failure result
replay_demos.py->>replay_demos.py: Update success/failure counters
end
replay_demos.py->>User: Print success rate & failed IDs
|
There was a problem hiding this comment.
Additional Comments (4)
-
scripts/tools/replay_demos.py, line 154-163 (link)logic: The
--validate_success_rateflag is defined but never used. The success validation code runs unconditionally. The success_term extraction and validation should be guarded byargs_cli.validate_success_rate: -
scripts/tools/replay_demos.py, line 164 (link)style: Trailing tabs on this line (whitespace-only line with tabs)
-
scripts/tools/replay_demos.py, line 243 (link)style: Trailing tabs on this line (whitespace-only line with tabs)
-
scripts/tools/replay_demos.py, line 289-294 (link)logic: These success statistics will always be printed, even when
--validate_success_rateis not specified. Should be conditional on the flag:
1 file reviewed, 4 comments
|
@jtigue-bdai @Mayankm96 Could you help review this PR?Thanks. |
peterd-NV
left a comment
There was a problem hiding this comment.
Thanks for the fixes. The changes look good, I left a comment regarding one of the print statements as something that I think should be changed before merge.
| f"Successfully replayed {recorded_episode_count} episode{plural_trailing_s} out" | ||
| f" of {replayed_episode_count} demos.", | ||
| " ", | ||
| current_episode_indices[env_id], |
There was a problem hiding this comment.
I think this print statement can be cleaned up a bit. Currently it's printing the episode index of the env_id without any explanation so it just shows up as a random integer. E.g. it looks something like:
Successfully replayed 2 episodes out of 5 demos. 1
I think we should either remove it (and the blank space before it), or add a more descriptive message.
There was a problem hiding this comment.
Fair point. Clean the message. Could you help review it? Thanks.
|
Hi @peterd-NV, should I ask for feedback from other reviewers, or will this be merged directly later? Thanks. |
…on success. (isaac-sim#4170) # Description Add support for validating replay success using the task’s termination criteria in scripts/tools/replay_demos.py. ## Type of change - New feature (non-breaking change which adds functionality) ## Modifications Only "scripts/tools/replay_demos.py" is modified. ## Verification 1. Download the pre-recorded dataset.hdf5 for the Isaac-Stack-Cube-Franka-IK-Rel-v0 task from the [link](https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/IsaacLab/Mimic/franka_stack_datasets/dataset.hdf5) provided in the [teleoperation-imitation-learning](https://isaac-sim.github.io/IsaacLab/main/source/overview/imitation-learning/teleop_imitation.html#teleoperation-imitation-learning) documentation. And place it in the `dataset` folder. 2. Run the following command to verify the changes: `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate` 3. For testing, I also augmented the above HDF5 file to a new one with 50 demonstration [trajectories](https://nvidia-my.sharepoint.com/:u:/p/weihuaz/IQAg9ke_LIefRonAMIZ7QyzfAeH_ydqwVbBGsPqwCSD0q3w?e=RqvPNw). You can use it to test the multi-env success rate. `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate --num_envs 13` No matter how many environments are enabled, the output should be: > Successfully replayed: 31/50 > Failed demo IDs (19 total): > [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 23, 34, 45, 46, 47, 48, 49] ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
…on success. (isaac-sim#4170) # Description Add support for validating replay success using the task’s termination criteria in scripts/tools/replay_demos.py. ## Type of change - New feature (non-breaking change which adds functionality) ## Modifications Only "scripts/tools/replay_demos.py" is modified. ## Verification 1. Download the pre-recorded dataset.hdf5 for the Isaac-Stack-Cube-Franka-IK-Rel-v0 task from the [link](https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/IsaacLab/Mimic/franka_stack_datasets/dataset.hdf5) provided in the [teleoperation-imitation-learning](https://isaac-sim.github.io/IsaacLab/main/source/overview/imitation-learning/teleop_imitation.html#teleoperation-imitation-learning) documentation. And place it in the `dataset` folder. 2. Run the following command to verify the changes: `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate` 3. For testing, I also augmented the above HDF5 file to a new one with 50 demonstration [trajectories](https://nvidia-my.sharepoint.com/:u:/p/weihuaz/IQAg9ke_LIefRonAMIZ7QyzfAeH_ydqwVbBGsPqwCSD0q3w?e=RqvPNw). You can use it to test the multi-env success rate. `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate --num_envs 13` No matter how many environments are enabled, the output should be: > Successfully replayed: 31/50 > Failed demo IDs (19 total): > [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 23, 34, 45, 46, 47, 48, 49] ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
…on success. (isaac-sim#4170) # Description Add support for validating replay success using the task’s termination criteria in scripts/tools/replay_demos.py. ## Type of change - New feature (non-breaking change which adds functionality) ## Modifications Only "scripts/tools/replay_demos.py" is modified. ## Verification 1. Download the pre-recorded dataset.hdf5 for the Isaac-Stack-Cube-Franka-IK-Rel-v0 task from the [link](https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/IsaacLab/Mimic/franka_stack_datasets/dataset.hdf5) provided in the [teleoperation-imitation-learning](https://isaac-sim.github.io/IsaacLab/main/source/overview/imitation-learning/teleop_imitation.html#teleoperation-imitation-learning) documentation. And place it in the `dataset` folder. 2. Run the following command to verify the changes: `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate` 3. For testing, I also augmented the above HDF5 file to a new one with 50 demonstration [trajectories](https://nvidia-my.sharepoint.com/:u:/p/weihuaz/IQAg9ke_LIefRonAMIZ7QyzfAeH_ydqwVbBGsPqwCSD0q3w?e=RqvPNw). You can use it to test the multi-env success rate. `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate --num_envs 13` No matter how many environments are enabled, the output should be: > Successfully replayed: 31/50 > Failed demo IDs (19 total): > [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 23, 34, 45, 46, 47, 48, 49] ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
…on success. (isaac-sim#4170) # Description Add support for validating replay success using the task’s termination criteria in scripts/tools/replay_demos.py. ## Type of change - New feature (non-breaking change which adds functionality) ## Modifications Only "scripts/tools/replay_demos.py" is modified. ## Verification 1. Download the pre-recorded dataset.hdf5 for the Isaac-Stack-Cube-Franka-IK-Rel-v0 task from the [link](https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/IsaacLab/Mimic/franka_stack_datasets/dataset.hdf5) provided in the [teleoperation-imitation-learning](https://isaac-sim.github.io/IsaacLab/main/source/overview/imitation-learning/teleop_imitation.html#teleoperation-imitation-learning) documentation. And place it in the `dataset` folder. 2. Run the following command to verify the changes: `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate` 3. For testing, I also augmented the above HDF5 file to a new one with 50 demonstration [trajectories](https://nvidia-my.sharepoint.com/:u:/p/weihuaz/IQAg9ke_LIefRonAMIZ7QyzfAeH_ydqwVbBGsPqwCSD0q3w?e=RqvPNw). You can use it to test the multi-env success rate. `python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate --num_envs 13` No matter how many environments are enabled, the output should be: > Successfully replayed: 31/50 > Failed demo IDs (19 total): > [0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 23, 34, 45, 46, 47, 48, 49] ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
Description
Add support for validating replay success using the task’s termination criteria in scripts/tools/replay_demos.py.
Type of change
Modifications
Only "scripts/tools/replay_demos.py" is modified.
Verification
datasetfolder.python scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_ratepython scripts/tools/replay_demos.py --task Isaac-Stack-Cube-Franka-IK-Rel-v0 --dataset_file ./dataset/dataset.hdf5 --validate_success_rate --num_envs 13No matter how many environments are enabled, the output should be:
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there