Skip to content

Handle crop_shape=None in Diffusion Policy #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alexander-soare
Copy link
Contributor

@alexander-soare alexander-soare commented May 28, 2024

What this does

crop_shape=None is allowed and it indicates that no cropping should be done, but various places in the code don't handle it. This PR addresses that.

How it was tested

I tried to train diffusion policy with default settings but crop_shape=None and no exceptions were raised.

How to checkout & try? (for the reviewer)

python lerobot/scripts/train.py \
    hydra.job.name=test \
    env=pusht \
    env.task=PushT-v0 \
    dataset_repo_id=lerobot/pusht \
    policy=diffusion \
    policy.crop_shape=null \
    training.save_checkpoint=false \
    training.offline_steps=200000 \
    training.save_freq=20000 \
    training.eval_freq=10000 \
    eval.n_episodes=50 \
    eval.batch_size=50 \
    wandb.enable=false \
    wandb.disable_artifact=true \
    device=cuda \
    use_amp=true

This change is Reviewable

@alexander-soare alexander-soare added bug Something isn’t working correctly policies Items related to robot policies labels May 28, 2024
@alexander-soare alexander-soare self-assigned this May 28, 2024
Copy link
Collaborator

@aliberts aliberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: Some CI tests are either incomplete or have failed!, all files reviewed, all discussions resolved (waiting on @alexander-soare)

@alexander-soare alexander-soare merged commit 3d625ae into huggingface:main May 28, 2024
5 of 6 checks passed
@alexander-soare alexander-soare deleted the handle_crop_shape_is_none branch May 28, 2024 17:30
menhguin pushed a commit to menhguin/lerobot that referenced this pull request Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working correctly policies Items related to robot policies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants