Le robot is learning
Project description
LeRobot
Installation
Create a virtual environment with python 3.10, e.g. using conda
:
conda create -y -n lerobot python=3.10
conda activate lerobot
Install poetry
(if you don't have it already)
curl -sSL https://install.python-poetry.org | python -
Install dependencies
poetry install
If you encounter a disk space error, try to change your tmp dir to a location where you have enough disk space, e.g.
mkdir ~/tmp
export TMPDIR='~/tmp'
Install diffusion_policy
#HACK
# from this directory
git clone https://github.com/real-stanford/diffusion_policy
cp -r diffusion_policy/diffusion_policy $(poetry env info -p)/lib/python3.10/site-packages/
Usage
Train
python lerobot/scripts/train.py \
hydra.job.name=pusht \
env=pusht
Visualize offline buffer
python lerobot/scripts/visualize_dataset.py \
hydra.run.dir=tmp/$(date +"%Y_%m_%d") \
env=pusht
Visualize online buffer / Eval
python lerobot/scripts/eval.py \
hydra.run.dir=tmp/$(date +"%Y_%m_%d") \
env=pusht
TODO
- priority update doesnt match FOWM or original paper
- self.step=100000 should be updated at every step to adjust to horizon of planner
- prefetch replay buffer to speedup training
- parallelize env to speedup eval
- clean checkpointing / loading
- clean logging
- clean config
- clean hyperparameter tuning
- add pusht
- add aloha
- add act
- add diffusion
- add aloha 2
Profile
Example
from torch.profiler import profile, record_function, ProfilerActivity
def trace_handler(prof):
prof.export_chrome_trace(f"tmp/trace_schedule_{prof.step_num}.json")
with profile(
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
schedule=torch.profiler.schedule(
wait=2,
warmup=2,
active=3,
),
on_trace_ready=trace_handler
) as prof:
with record_function("eval_policy"):
for i in range(num_episodes):
prof.step()
python lerobot/scripts/eval.py \
pretrained_model_path=/home/rcadene/code/fowm/logs/xarm_lift/all/default/2/models/final.pt \
eval_episodes=7
Contribute
Style
# install if needed
pre-commit install
# apply style and linter checks before git commit
pre-commit run -a
Tests
pytest -sx tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lerobot-0.1.0.tar.gz
(38.1 kB
view details)
Built Distribution
lerobot-0.1.0-py3-none-any.whl
(50.2 kB
view details)
File details
Details for the file lerobot-0.1.0.tar.gz
.
File metadata
- Download URL: lerobot-0.1.0.tar.gz
- Upload date:
- Size: 38.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a5a3cd93b5eeb86245974882928d45ab764d5313810add9b01f24440ccddbee |
|
MD5 | 23e7384d91f8e346c2d073e0a66c4df9 |
|
BLAKE2b-256 | 2ea22c04103e737097030018bd4f2971ae70ec7b8adfa5afcada8d5b4373358a |
File details
Details for the file lerobot-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: lerobot-0.1.0-py3-none-any.whl
- Upload date:
- Size: 50.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a3b1f17796ab8723cf799d97dde0030cd3031d6d31b959a26b4150e5f3bff85 |
|
MD5 | ffc80ea0753e56bb115a643362cb4e05 |
|
BLAKE2b-256 | 828674b3389249d1b20a2af8d6866b5bde49c823028727a4b96884ac12c43f40 |