From 042e1939955a1eba771f0f0a31532d87b11a9993 Mon Sep 17 00:00:00 2001 From: jganitzer <88656546+jganitzer@users.noreply.github.com> Date: Fri, 31 May 2024 19:14:14 +0200 Subject: [PATCH 1/4] Typo in examples\4_train_policy_with_script.md (#235) --- examples/4_train_policy_with_script.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/4_train_policy_with_script.md b/examples/4_train_policy_with_script.md index 5587a6e4..70a5b505 100644 --- a/examples/4_train_policy_with_script.md +++ b/examples/4_train_policy_with_script.md @@ -70,7 +70,7 @@ python lerobot/scripts/train.py policy=act env=aloha There are two things to note here: - Config overrides are passed as `param_name=param_value`. -- Here we have overridden the defaults section. `policy=act` tells Hydra to use `policy/act.yaml`, and `env=aloha` tells Hydra to use `env/pusht.yaml`. +- Here we have overridden the defaults section. `policy=act` tells Hydra to use `policy/act.yaml`, and `env=aloha` tells Hydra to use `env/aloha.yaml`. _As an aside: we've set up all of our configurations so that they reproduce state-of-the-art results from papers in the literature._ From cf15cba5fc932fcbb03e2ca490b1d3870da0f8db Mon Sep 17 00:00:00 2001 From: Alexander Soare Date: Mon, 3 Jun 2024 13:04:24 +0100 Subject: [PATCH 2/4] Remove redundant slicing operation in Diffusion Policy (#240) --- lerobot/common/policies/diffusion/modeling_diffusion.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lerobot/common/policies/diffusion/modeling_diffusion.py b/lerobot/common/policies/diffusion/modeling_diffusion.py index 273f4f75..e0482143 100644 --- a/lerobot/common/policies/diffusion/modeling_diffusion.py +++ b/lerobot/common/policies/diffusion/modeling_diffusion.py @@ -239,10 +239,8 @@ class DiffusionModel(nn.Module): global_cond = torch.cat([batch["observation.state"], img_features], dim=-1).flatten(start_dim=1) # run sampling - sample = self.conditional_sample(batch_size, global_cond=global_cond) + actions = self.conditional_sample(batch_size, global_cond=global_cond) - # `horizon` steps worth of actions (from the first observation). - actions = sample[..., : self.config.output_shapes["action"][0]] # Extract `n_action_steps` steps worth of actions (from the current observation). start = n_obs_steps - 1 end = start + self.config.n_action_steps From bd3111f28b9549d53019d05ff06ad2f6b465c4bf Mon Sep 17 00:00:00 2001 From: Simon Alibert <75076266+aliberts@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:35:16 +0200 Subject: [PATCH 3/4] Fix `visualize_dataset.py --help` (#241) --- lerobot/scripts/visualize_dataset.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lerobot/scripts/visualize_dataset.py b/lerobot/scripts/visualize_dataset.py index 58da6a47..b5f40d11 100644 --- a/lerobot/scripts/visualize_dataset.py +++ b/lerobot/scripts/visualize_dataset.py @@ -224,7 +224,8 @@ def main(): help=( "Mode of viewing between 'local' or 'distant'. " "'local' requires data to be on a local machine. It spawns a viewer to visualize the data locally. " - "'distant' creates a server on the distant machine where the data is stored. Visualize the data by connecting to the server with `rerun ws://localhost:PORT` on the local machine." + "'distant' creates a server on the distant machine where the data is stored. " + "Visualize the data by connecting to the server with `rerun ws://localhost:PORT` on the local machine." ), ) parser.add_argument( @@ -245,8 +246,8 @@ def main(): default=0, help=( "Save a .rrd file in the directory provided by `--output-dir`. " - "It also deactivates the spawning of a viewer. ", - "Visualize the data by running `rerun path/to/file.rrd` on your local machine.", + "It also deactivates the spawning of a viewer. " + "Visualize the data by running `rerun path/to/file.rrd` on your local machine." ), ) parser.add_argument( From b0d954c6e167d1780f6d76fba99df68fb43a7413 Mon Sep 17 00:00:00 2001 From: Ruijie Date: Tue, 4 Jun 2024 06:21:28 -0400 Subject: [PATCH 4/4] Fix bug in normalize to avoid divide by zero (#239) Co-authored-by: rj Co-authored-by: Remi --- lerobot/common/policies/normalize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerobot/common/policies/normalize.py b/lerobot/common/policies/normalize.py index d638c541..9b055f7e 100644 --- a/lerobot/common/policies/normalize.py +++ b/lerobot/common/policies/normalize.py @@ -147,7 +147,7 @@ class Normalize(nn.Module): assert not torch.isinf(min).any(), _no_stats_error_str("min") assert not torch.isinf(max).any(), _no_stats_error_str("max") # normalize to [0,1] - batch[key] = (batch[key] - min) / (max - min) + batch[key] = (batch[key] - min) / (max - min + 1e-8) # normalize to [-1, 1] batch[key] = batch[key] * 2 - 1 else: