From 725b446ad6e15499c4d92acce24b72103d4ce777 Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Mon, 24 Mar 2025 23:40:22 +0100 Subject: [PATCH 1/3] fix(deps): constrain PyAV version to resolve OpenCV-python ffmpeg version conflict (#883) Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com> --- examples/10_use_so100.md | 6 ------ examples/11_use_lekiwi.md | 6 ------ examples/11_use_moss.md | 7 ------- examples/7_get_started_with_real_robot.md | 12 ------------ examples/8_use_stretch.md | 7 ------- examples/9_use_aloha.md | 7 ------- pyproject.toml | 2 +- 7 files changed, 1 insertion(+), 46 deletions(-) diff --git a/examples/10_use_so100.md b/examples/10_use_so100.md index d24232299..b854f69c8 100644 --- a/examples/10_use_so100.md +++ b/examples/10_use_so100.md @@ -62,12 +62,6 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot cd ~/lerobot && pip install -e ".[feetech]" ``` -*EXTRA: For Linux only (not Mac)*: install extra dependencies for recording datasets: -```bash -conda install -y -c conda-forge ffmpeg -pip uninstall -y opencv-python -conda install -y -c conda-forge "opencv>=4.10.0" -``` Great :hugs:! You are now done installing LeRobot and we can begin assembling the SO100 arms :robot:. Every time you now want to use LeRobot you can go to the `~/lerobot` folder where we installed LeRobot and run one of the commands. diff --git a/examples/11_use_lekiwi.md b/examples/11_use_lekiwi.md index dc310af25..798b7bd36 100644 --- a/examples/11_use_lekiwi.md +++ b/examples/11_use_lekiwi.md @@ -113,12 +113,6 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot cd ~/lerobot && pip install -e ".[feetech]" ``` -*EXTRA: For Linux only (not Mac)*: install extra dependencies for recording datasets: -```bash -conda install -y -c conda-forge ffmpeg -pip uninstall -y opencv-python -conda install -y -c conda-forge "opencv>=4.10.0" -``` Great :hugs:! You are now done installing LeRobot and we can begin assembling the SO100 arms and Mobile base :robot:. Every time you now want to use LeRobot you can go to the `~/lerobot` folder where we installed LeRobot and run one of the commands. diff --git a/examples/11_use_moss.md b/examples/11_use_moss.md index d2e020769..48d5dfb68 100644 --- a/examples/11_use_moss.md +++ b/examples/11_use_moss.md @@ -36,13 +36,6 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot cd ~/lerobot && pip install -e ".[feetech]" ``` -For Linux only (not Mac), install extra dependencies for recording datasets: -```bash -conda install -y -c conda-forge ffmpeg -pip uninstall -y opencv-python -conda install -y -c conda-forge "opencv>=4.10.0" -``` - ## Configure the motors Follow steps 1 of the [assembly video](https://www.youtube.com/watch?v=DA91NJOtMic) which illustrates the use of our scripts below. diff --git a/examples/7_get_started_with_real_robot.md b/examples/7_get_started_with_real_robot.md index 52ec673e4..cf103968c 100644 --- a/examples/7_get_started_with_real_robot.md +++ b/examples/7_get_started_with_real_robot.md @@ -46,13 +46,6 @@ Using `uv`: uv sync --extra "dynamixel" ``` -/!\ For Linux only, ffmpeg and opencv requires conda install for now. Run this exact sequence of commands: -```bash -conda install -c conda-forge ffmpeg -pip uninstall opencv-python -conda install -c conda-forge "opencv>=4.10.0" -``` - You are now ready to plug the 5V power supply to the motor bus of the leader arm (the smaller one) since all its motors only require 5V. Then plug the 12V power supply to the motor bus of the follower arm. It has two motors that need 12V, and the rest will be powered with 5V through the voltage convertor. @@ -834,11 +827,6 @@ It contains: - `dtRphone:33.84 (29.5hz)` which is the delta time of capturing an image from the phone camera in the thread running asynchronously. Troubleshooting: -- On Linux, if you encounter a hanging issue when using cameras, uninstall opencv and re-install it with conda: -```bash -pip uninstall opencv-python -conda install -c conda-forge opencv=4.10.0 -``` - On Linux, if you encounter any issue during video encoding with `ffmpeg: unknown encoder libsvtav1`, you can: - install with conda-forge by running `conda install -c conda-forge ffmpeg` (it should be compiled with `libsvtav1`), - or, install [Homebrew](https://brew.sh) and run `brew install ffmpeg` (it should be compiled with `libsvtav1`), diff --git a/examples/8_use_stretch.md b/examples/8_use_stretch.md index 802ea7187..02f1ddc1a 100644 --- a/examples/8_use_stretch.md +++ b/examples/8_use_stretch.md @@ -50,13 +50,6 @@ cd ~/lerobot && pip install -e ".[stretch]" > **Note:** If you get this message, you can ignore it: `ERROR: pip's dependency resolver does not currently take into account all the packages that are installed.` -For Linux only (not Mac), install extra dependencies for recording datasets: -```bash -conda install -y -c conda-forge ffmpeg -pip uninstall -y opencv-python -conda install -y -c conda-forge "opencv>=4.10.0" -``` - 7. Run a [system check](https://docs.hello-robot.com/0.3/getting_started/stretch_hardware_overview/#system-check) to make sure your robot is ready: ```bash stretch_system_check.py diff --git a/examples/9_use_aloha.md b/examples/9_use_aloha.md index 62dee5888..dad8e1c9f 100644 --- a/examples/9_use_aloha.md +++ b/examples/9_use_aloha.md @@ -35,13 +35,6 @@ git clone https://github.com/huggingface/lerobot.git ~/lerobot cd ~/lerobot && pip install -e ".[dynamixel, intelrealsense]" ``` -For Linux only (not Mac), install extra dependencies for recording datasets: -```bash -conda install -y -c conda-forge ffmpeg -pip uninstall -y opencv-python -conda install -y -c conda-forge "opencv>=4.10.0" -``` - ## Teleoperate **/!\ FOR SAFETY, READ THIS /!\** diff --git a/pyproject.toml b/pyproject.toml index 62111b566..1fa7b2460 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ dependencies = [ "omegaconf>=2.3.0", "opencv-python>=4.9.0", "packaging>=24.2", - "av>=12.0.5", + "av>=12.0.5,<13.0.0", "pymunk>=6.6.0", "pynput>=1.7.7", "pyzmq>=26.2.1", From a774af2eaba690a7a82f110e6f5c3f176ddf4286 Mon Sep 17 00:00:00 2001 From: Qizhi Chen Date: Tue, 25 Mar 2025 18:24:46 +0800 Subject: [PATCH 2/3] fix pi0 action padding name (#893) Co-authored-by: Steven Palma --- lerobot/common/policies/pi0/modeling_pi0.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerobot/common/policies/pi0/modeling_pi0.py b/lerobot/common/policies/pi0/modeling_pi0.py index bc53bf85b..7599fa635 100644 --- a/lerobot/common/policies/pi0/modeling_pi0.py +++ b/lerobot/common/policies/pi0/modeling_pi0.py @@ -313,7 +313,7 @@ class PI0Policy(PreTrainedPolicy): state = self.prepare_state(batch) lang_tokens, lang_masks = self.prepare_language(batch) actions = self.prepare_action(batch) - actions_is_pad = batch.get("actions_is_pad") + actions_is_pad = batch.get("action_is_pad") loss_dict = {} losses = self.model.forward(images, img_masks, lang_tokens, lang_masks, state, actions, noise, time) From 2c22f7d76da3fcbd06ad8fbfd6baf1b13f5f0956 Mon Sep 17 00:00:00 2001 From: AlexC Date: Tue, 25 Mar 2025 13:44:49 +0100 Subject: [PATCH 3/3] Add offline mode in the configuration for wandb logging (#897) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Palma --- lerobot/common/utils/wandb_utils.py | 1 + lerobot/configs/default.py | 1 + 2 files changed, 2 insertions(+) diff --git a/lerobot/common/utils/wandb_utils.py b/lerobot/common/utils/wandb_utils.py index 700ebea5d..3fe241d41 100644 --- a/lerobot/common/utils/wandb_utils.py +++ b/lerobot/common/utils/wandb_utils.py @@ -90,6 +90,7 @@ class WandBLogger: # TODO(rcadene): split train and eval, and run async eval with job_type="eval" job_type="train_eval", resume="must" if cfg.resume else None, + mode=self.cfg.mode if self.cfg.mode in ["online", "offline", "disabled"] else "online", ) print(colored("Logs will be synced with wandb.", "blue", attrs=["bold"])) logging.info(f"Track this run --> {colored(wandb.run.get_url(), 'yellow', attrs=['bold'])}") diff --git a/lerobot/configs/default.py b/lerobot/configs/default.py index b23bbb6d9..ce72466a8 100644 --- a/lerobot/configs/default.py +++ b/lerobot/configs/default.py @@ -48,6 +48,7 @@ class WandBConfig: entity: str | None = None notes: str | None = None run_id: str | None = None + mode: str | None = None # Allowed values: 'online', 'offline' 'disabled'. Defaults to 'online' @dataclass