Skip to main content

Tests Passing GitHub Contributors Issues

Benchmarking Knowledge Transfer for Lifelong Robot Learning

Bo Liu, Yifeng Zhu, Chongkai Gao, Yihao Feng, Qiang Liu, Yuke Zhu, Peter Stone

[Website] [Paper] [Docs]


pull_figure

LIBERO is designed for studying knowledge transfer in multitask and lifelong robot learning problems. Successfully resolving these problems require both declarative knowledge about objects/spatial relationships and procedural knowledge about motion/behaviors. LIBERO provides:

  • a procedural generation pipeline that could in principle generate an infinite number of manipulation tasks.
  • 130 tasks grouped into four task suites: LIBERO-Spatial, LIBERO-Object, LIBERO-Goal, and LIBERO-100. The first three task suites have controlled distribution shifts, meaning that they require the transfer of a specific type of knowledge. In contrast, LIBERO-100 consists of 100 manipulation tasks that require the transfer of entangled knowledge. LIBERO-100 is further splitted into LIBERO-90 for pretraining a policy and LIBERO-10 for testing the agent's downstream lifelong learning performance.
  • five research topics.
  • three visuomotor policy network architectures.
  • three lifelong learning algorithms with the sequential finetuning and multitask learning baselines.

Contents

Installation

Option A — install from PyPI (rlinf-libero)

pip install rlinf-libero

The PyPI wheel ships the code plus the small bddl_files / init_files data, but not the ~405MB of mesh/texture assets (they exceed PyPI's 100MB limit). After installing, download the assets once:

libero-download-assets

This fetches the assets from the Hugging Face Hub into the installed package's libero/libero/assets directory. To point at a different source repo, pass --repo-id <org>/<repo> or set the LIBERO_ASSETS_REPO environment variable.

Option B — install from source (editable)

A git checkout already contains the assets, so no separate download is needed (this is the flow RLinf uses):

conda create -n libero python=3.8.13
conda activate libero
git clone https://github.com/RLinf/LIBERO.git
cd LIBERO
pip install -e .

Add the lifelong-learning training stack (needed only for libero.lifelong.*) with the train extra:

pip install -e ".[train]"

Note on PyTorch. torch is left unpinned so it defers to whatever build you already have installed (e.g. a CUDA build from the PyTorch index). Install the torch/torchvision build matching your CUDA version before or after installing LIBERO if you need GPU support.

Datasets

We provide high-quality human teleoperation demonstrations for the four task suites in LIBERO. To download the demonstration dataset, run:

python benchmark_scripts/download_libero_datasets.py

By default, the dataset will be stored under the LIBERO folder and all four datasets will be downloaded. To download a specific dataset, use

python benchmark_scripts/download_libero_datasets.py --datasets DATASET

where DATASET is chosen from [libero_spatial, libero_object, libero_100, libero_goal.

NEW!!!

Alternatively, you can download the dataset from HuggingFace by using:

python benchmark_scripts/download_libero_datasets.py --use-huggingface

This option can also be combined with the specific dataset selection:

python benchmark_scripts/download_libero_datasets.py --datasets DATASET --use-huggingface

The datasets hosted on HuggingFace are available at here.

Assets

The simulation assets (meshes, textures, scenes; ~405MB) live under libero/libero/assets. They are included in a git checkout but excluded from the PyPI wheel. To download them into an installed package:

libero-download-assets                 # into the package assets dir
libero-download-assets --repo-id ORG/REPO --force

If the assets already exist somewhere on disk (a shared volume, another checkout), skip the download and symlink the package at them — either explicitly or via the LIBERO_ASSET_PATH environment variable:

libero-download-assets --link /path/to/existing/assets
# or
export LIBERO_ASSET_PATH=/path/to/existing/assets
libero-download-assets

or, from a source tree:

python benchmark_scripts/download_libero_assets.py

For maintainers publishing rlinf-libero: the assets must be hosted on a Hugging Face repo (default RLinf/LIBERO-assets). Create it once and upload the tree from a checkout that has the assets:

huggingface-cli repo create RLinf/LIBERO-assets --repo-type dataset
huggingface-cli upload RLinf/LIBERO-assets libero/libero/assets . --repo-type dataset

Getting Started

For a detailed walk-through, please either refer to the documentation or the notebook examples provided under the notebooks folder. In the following, we provide example scripts for retrieving a task, training and evaluation.

Task

The following is a minimal example of retrieving a specific task from a specific task suite.

from libero.libero import benchmark
from libero.libero.envs import OffScreenRenderEnv


benchmark_dict = benchmark.get_benchmark_dict()
task_suite_name = "libero_10" # can also choose libero_spatial, libero_object, etc.
task_suite = benchmark_dict[task_suite_name]()

# retrieve a specific task
task_id = 0
task = task_suite.get_task(task_id)
task_name = task.name
task_description = task.language
task_bddl_file = os.path.join(get_libero_path("bddl_files"), task.problem_folder, task.bddl_file)
print(f"[info] retrieving task {task_id} from suite {task_suite_name}, the " + \
      f"language instruction is {task_description}, and the bddl file is {task_bddl_file}")

# step over the environment
env_args = {
    "bddl_file_name": task_bddl_file,
    "camera_heights": 128,
    "camera_widths": 128
}
env = OffScreenRenderEnv(**env_args)
env.seed(0)
env.reset()
init_states = task_suite.get_task_init_states(task_id) # for benchmarking purpose, we fix the a set of initial states
init_state_id = 0
env.set_init_state(init_states[init_state_id])

dummy_action = [0.] * 7
for step in range(10):
    obs, reward, done, info = env.step(dummy_action)
env.close()

Currently, we only support sparse reward function (i.e., the agent receives +1 when the task is finished). As sparse-reward RL is extremely hard to learn, currently we mainly focus on lifelong imitation learning.

Training

To start a lifelong learning experiment, please choose:

  • BENCHMARK from [LIBERO_SPATIAL, LIBERO_OBJECT, LIBERO_GOAL, LIBERO_90, LIBERO_10]
  • POLICY from [bc_rnn_policy, bc_transformer_policy, bc_vilt_policy]
  • ALGO from [base, er, ewc, packnet, multitask]

then run the following:

export CUDA_VISIBLE_DEVICES=GPU_ID && \
export MUJOCO_EGL_DEVICE_ID=GPU_ID && \
python libero/lifelong/main.py seed=SEED \
                               benchmark_name=BENCHMARK \
                               policy=POLICY \
                               lifelong=ALGO

Please see the documentation for the details of reproducing the study results.

Evaluation

By default the policies will be evaluated on the fly during training. If you have limited computing resource of GPUs, we offer an evaluation script for you to evaluate models separately.

python libero/lifelong/evaluate.py --benchmark BENCHMARK_NAME \
                                   --task_id TASK_ID \ 
                                   --algo ALGO_NAME \
                                   --policy POLICY_NAME \
                                   --seed SEED \
                                   --ep EPOCH \
                                   --load_task LOAD_TASK \
                                   --device_id CUDA_ID

Citation

If you find LIBERO to be useful in your own research, please consider citing our paper:

@article{liu2023libero,
  title={LIBERO: Benchmarking Knowledge Transfer for Lifelong Robot Learning},
  author={Liu, Bo and Zhu, Yifeng and Gao, Chongkai and Feng, Yihao and Liu, Qiang and Zhu, Yuke and Stone, Peter},
  journal={arXiv preprint arXiv:2306.03310},
  year={2023}
}

License

Component License
Codebase MIT License
Datasets Creative Commons Attribution 4.0 International (CC BY 4.0)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rlinf_libero-0.1.2.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rlinf_libero-0.1.2-py3-none-any.whl (3.2 MB view details)

Uploaded Python 3

File details

Details for the file rlinf_libero-0.1.2.tar.gz.

File metadata

  • Download URL: rlinf_libero-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rlinf_libero-0.1.2.tar.gz
Algorithm Hash digest
SHA256 44113c8395a0283b40b279eafe5f4dd5449daad3681ee6ae0ec89ee79b4a717a
MD5 8612b6e4d6c3192d7bbbb52eb41de3d8
BLAKE2b-256 37f5f1daa231eb0bbcedd0d85ea793f1d11f5c933351c4e6c81eea26f72317dc

See more details on using hashes here.

File details

Details for the file rlinf_libero-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rlinf_libero-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rlinf_libero-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4d1d6c2d3a6af908a4d81f452cfae772e9c274d22a414adeecf9c8c6e01f426c
MD5 126a2d6ef170c2257160c7326e590d03
BLAKE2b-256 973e20227446698576dc7c0b44ecf3ba06531592e3b4cf22ae030f5b86892212

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page