Skip to content

Conversation

alexander-soare
Copy link
Contributor

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

What does this PR do?

Primary changes:

  • Make all policies subclass PytorchModelHubMixin as well as nn.Module.
  • Remove save and load from all policies.
  • Update logger.py to use save_pretrained instead of save, and to separately save the Hydra config as a yaml file.
  • Update eval.py to use from_pretrained (this consolidates the two user paths into one, at the expense of some conditional branching in the code).
  • Update examples to conform.
  • Update README section on uploading policies.
  • Remove "pretrained_model_path" from yaml config.

Side changes:

  • Add get_policy_and_config_classes to avoid repetition of the conditional branching across policy names.
  • Change ACTConfig.d_model to ACTConfig.dim_model for consistency with ACTConfig.dim_feedforward.
  • Change model saving directory from "models" to "checkpoints" to avoid confusion between "policy" and "model" and be more explicit.
  • Add functionality to eval.py to be able to evaluate a non-pretrained model.

Not for this PR:

  • TDMPC.
  • Script for uploading training checkpoint to the hub.
  • Model cards.

How was it tested?

  • CI

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR. Try to avoid tagging more than 3 people.

@alexander-soare alexander-soare marked this pull request as draft May 1, 2024 12:13
@alexander-soare alexander-soare marked this pull request as ready for review May 1, 2024 12:23
@alexander-soare alexander-soare marked this pull request as draft May 1, 2024 13:14
@alexander-soare alexander-soare marked this pull request as ready for review May 1, 2024 14:27
Copy link
Collaborator

@Cadene Cadene left a comment

Choose a reason for hiding this comment

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

Left some comments. Nothing blocking merging. Nice work!!!

@alexander-soare alexander-soare removed the request for review from qgallouedec May 1, 2024 15:16
@alexander-soare alexander-soare merged commit a489109 into main May 1, 2024
@alexander-soare alexander-soare deleted the alexander-soare/use_hub_mixin branch May 1, 2024 15:17
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Hey there! Sorry I only spotted this PR now :) Nice work to use PytorchModelHubMixin to integrate with the Hub!

I left a comment below as I think it can be even more tightly integrated for better documentation/discoverability on the Hub. In general, never hesitate to ping me (@Wauplin) in any PR that is related to the Hub. I'm maintain huggingface_hub and I'd be happy to help if you have questions about how other HF libraries are doing (and stay consistent with them) 🤗

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
Ricci084 pushed a commit to JeffWang987/lerobot that referenced this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants