Refactor act#68
Merged
alexander-soare merged 28 commits intoApr 9, 2024
Merged
Conversation
…orchrl' into refactor_act_remove_torchrl
…orchrl' into refactor_act_remove_torchrl
…orchrl' into refactor_act_remove_torchrl
…orchrl' into refactor_act_remove_torchrl
…orchrl' into refactor_act_remove_torchrl
…orchrl' into refactor_act_remove_torchrl
…orchrl' into refactor_act_remove_torchrl
Cadene
reviewed
Apr 8, 2024
Cadene
reviewed
Apr 8, 2024
Cadene
reviewed
Apr 8, 2024
Comment on lines
+574
to
+578
| x = self.multihead_attn( | ||
| query=self.maybe_add_pos_embed(x, decoder_pos_embed), | ||
| key=self.maybe_add_pos_embed(encoder_out, encoder_pos_embed), | ||
| value=encoder_out, | ||
| )[0] |
Cadene
reviewed
Apr 8, 2024
| if self.normalize_before: | ||
| x = self.norm1(x) | ||
| q = k = self.maybe_add_pos_embed(x, decoder_pos_embed) | ||
| x = self.self_attn(q, k, value=x)[0] |
Cadene
reviewed
Apr 8, 2024
| Returns: | ||
| A (1, C, H, W) batch of corresponding sinusoidal positional embeddings. | ||
| """ | ||
| not_mask = torch.ones_like(x[0, [0]]) # (1, H, W) |
Contributor
There was a problem hiding this comment.
Why x[0, [0]]? Could we do something more readable?
Contributor
Author
There was a problem hiding this comment.
Good shout. This is what I normally do (see revision). Is that more readable for you? Otherwise, I need to do ones and get the dtype and device.
Cadene
reviewed
Apr 8, 2024
Cadene
reviewed
Apr 8, 2024
Cadene
reviewed
Apr 8, 2024
Cadene
reviewed
Apr 8, 2024
| dataloader = torch.utils.data.DataLoader( | ||
| dataset, | ||
| num_workers=4, | ||
| num_workers=0, |
Contributor
Author
There was a problem hiding this comment.
Yep sorry. Btw IMO this goes in config.
Cadene
reviewed
Apr 8, 2024
Cadene
reviewed
Apr 8, 2024
Contributor
Author
|
@Cadene many thanks for the review. Bty |
…_torchrl' into refactor_act
…_torchrl' into refactor_act
Cadene
approved these changes
Apr 9, 2024
Cadene
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this PR :)
I pushed some changes to user/rcadene/2024_03_31_remove_torchrl.
In particular, I passed the test_policies.py with Aloha/Act.
You will need to solve some non-trivial merge issues.
Dont hesitate to call me so that we solve them together.
Thanks!
…_torchrl' into refactor_act
…_torchrl' into refactor_act
07c28a2
into
huggingface:user/rcadene/2024_03_31_remove_torchrl
menhguin
pushed a commit
to menhguin/lerobot
that referenced
this pull request
Feb 9, 2025
Kalcy-U
referenced
this pull request
in Kalcy-U/lerobot
May 13, 2025
ZoreAnuj
pushed a commit
to luckyrobots/lerobot
that referenced
this pull request
Jul 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes for reviewers:
DATA_DIR=data python lerobot/scripts/eval.py --hub-id lerobot/act_aloha_transfer_cube_human-original_repo eval_episodes=1 rollout_batch_size=1to evaluate the ported weights from the original repo.sim_transfer_cube_humancan be trained to match/surpass the original weights.Still left to do
Make sure this is reproducible with scripts/configs.Upload converted weights, conversion script, converted stats, stats conversion script, to hub.Train on LeRobot with:
export DATA_DIR=data python lerobot/scripts/train.py \ hydra.job.name=act_aloha_sim_insertion_scripted \ env=aloha \ env.task=sim_insertion \ dataset_id=aloha_sim_insertion_scripted \ policy=act \ log_freq=50 \ eval_freq=2500 \ rollout_batch_size=20 \ eval_episodes=20 \ policy.grad_clip_norm=100 \ policy.use_vae=true \ horizon=100 \ wandb.enable=true \ hydra.run.dir=outputs/train/act_aloha_sim_insertion_scripted \ device=cuda \ offline_steps=80000 \ prefetch=4 \ save_model=true \ save_freq=5000 \