Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Lifelong-Robot-Learning/LIBERO
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: bowenxxxx/LIBERO-Generalization
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 9 commits
  • 23 files changed
  • 1 contributor

Commits on May 25, 2024

  1. LIBERO change

    bowenxxxx committed May 25, 2024
    Copy the full SHA
    32fa42e View commit details

Commits on Jul 3, 2024

  1. Copy the full SHA
    7ce6c1d View commit details
  2. table rgba

    bowenxxxx committed Jul 3, 2024
    Copy the full SHA
    83cec49 View commit details
  3. background for libero long

    bowenxxxx committed Jul 3, 2024
    Copy the full SHA
    1d2485d View commit details

Commits on Sep 19, 2024

  1. libero long reflection

    bowenxxxx committed Sep 19, 2024
    Copy the full SHA
    2aab4ac View commit details
  2. libero long reflection

    bowenxxxx committed Sep 19, 2024
    Copy the full SHA
    b4f217b View commit details
  3. libero_long varitaions

    bowenxxxx committed Sep 19, 2024
    Copy the full SHA
    3e0633a View commit details
  4. libero_long variations

    bowenxxxx committed Sep 19, 2024
    Copy the full SHA
    86114c4 View commit details

Commits on Dec 2, 2024

  1. readme

    bowenxxxx committed Dec 2, 2024
    Copy the full SHA
    be4ec12 View commit details
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .idea/LIBERO-Generalization.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

171 changes: 1 addition & 170 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,170 +1 @@
<div align="center">
<img src="https://github.com/Lifelong-Robot-Learning/LIBERO/blob/master/images/libero_logo.png" width="360">


<p align="center">
<a href="https://github.com/Lifelong-Robot-Learning/LIBERO/actions">
<img alt="Tests Passing" src="https://github.com/anuraghazra/github-readme-stats/workflows/Test/badge.svg" />
</a>
<a href="https://github.com/Lifelong-Robot-Learning/LIBERO/graphs/contributors">
<img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/Lifelong-Robot-Learning/LIBERO" />
</a>
<a href="https://github.com/Lifelong-Robot-Learning/LIBERO/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/Lifelong-Robot-Learning/LIBERO?color=0088ff" />

## **Benchmarking Knowledge Transfer for Lifelong Robot Learning**

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

[[Website]](https://libero-project.github.io)
[[Paper]](https://arxiv.org/pdf/2306.03310.pdf)
[[Docs]](https://lifelong-robot-learning.github.io/LIBERO/)
______________________________________________________________________
![pull_figure](https://github.com/Lifelong-Robot-Learning/LIBERO/blob/master/images//fig1.png)
</div>

**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](#Installation)
- [Datasets](#Dataset)
- [Getting Started](#Getting-Started)
- [Task](#Task)
- [Training](#Training)
- [Evaluation](#Evaluation)
- [Citation](#Citation)
- [License](#License)


# Installtion
Please run the following commands in the given order to install the dependency for **LIBERO**.
```
conda create -n libero python=3.8.13
conda activate libero
git clone https://github.com/Lifelong-Robot-Learning/LIBERO.git
cd LIBERO
pip install -r requirements.txt
pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
```

Then install the `libero` package:
```
pip install -e .
```

# Datasets
We provide high-quality human teleoperation demonstrations for the four task suites in **LIBERO**. To download the demonstration dataset, run:
```python
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
python benchmark_scripts/download_libero_datasets.py --datasets DATASET
```
where ```DATASET``` is chosen from `[libero_spatial, libero_object, libero_100, libero_goal`.


# 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.
```python
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:

```shell
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.

```shell
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:

```bibtex
@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](LICENSE) |
| Datasets | [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/legalcode) |
Benchmark for Generalization on top of **LIBERO** (https://libero-project.github.io)
2 changes: 1 addition & 1 deletion libero/libero/assets/scenes/libero_floor_coffee_style.xml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@

<texture file="coffee_table_seats/FabricLeatherBuffaloRustic001_COL_VAR1_4K.png" name="tex-coffee_table_seats" type="2d"/>
<material name="coffee_table_seats" reflectance="0.5" texrepeat="1 1" texture="tex-coffee_table_seats" texuniform="false"/>
<mesh file="coffee_table_seats/visual/coffee_table_seats_vis.msh" name="coffee_table_seats_vis" scale="1.0 1.0 1.0"/>
<mesh file="coffee_table_seats/visual/coffee_table_seats_vis.msh" name="coffee_table_seats_vis" scale="0.8 0.4 0.1"/>

</asset>
<worldbody>
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<mujoco model="table_arena">
<asset>
<texture builtin="gradient" height="256" rgb1=".9 .9 1." rgb2=".2 .3 .4" type="skybox" width="256"/>
<texture file="../textures/tile_grigia_caldera_porcelain_floor.png" type="2d" name="texplane"/>

<material name="floorplane" reflectance="0.0" shininess="0.0"
specular="0.0" texrepeat="3 3" texture="texplane" texuniform="true"/>
<!-- ceramic table texture and material-->
<texture file="../textures/martin_novak_wood_table.png" type="cube" name="tex-table"/>
<material name="table_texture" reflectance="0.0" shininess="0.0" specular="0.2" texrepeat="1 1" texture="tex-table" />
<!-- steel legs -->
<texture file="../textures/martin_novak_wood_table.png" type="cube" name="tex-table-legs"/>
<material name="table_legs" reflectance="0.8" shininess="0.8" texrepeat="1 1" texture="tex-table-legs" />
<!-- plaster walls -->
<texture file="../textures/smooth_light_gray_plaster.png" type="2d" name="tex-wall"/>

<material name="walls_mat" reflectance="0.0" shininess="0.3" specular="0.8" texrepeat="3 3" texture="tex-wall" texuniform="true" />
<!-- added table texture and material for domain randomization -->
<texture name="textable" builtin="flat" height="512" width="512" rgb1="0.8 0.8 0.8" rgb2="0.8 0.8 0.8"/>
<material name="table_mat" texture="textable" />

<texture file="kitchen_background/kitchen_background.png" name="tex-kitchen_background" type="2d"/>
<material name="kitchen_background" reflectance="0.5" texrepeat="1 1" texture="tex-kitchen_background" texuniform="false"/>
<mesh file="kitchen_background/visual/kitchen_background_vis.msh" name="kitchen_background_vis" scale="0.01 0.01 0.01"/>

<texture file="kitchen_background_pot/kitchen_background_pot.png" name="tex-kitchen_background_pot" type="2d"/>
<material name="kitchen_background_pot" reflectance="0.5" texrepeat="1 1" texture="tex-kitchen_background_pot" texuniform="false"/>
<mesh file="kitchen_background_pot/visual/kitchen_background_pot_vis.msh" name="kitchen_background_pot_vis" scale="0.01 0.01 0.01"/>

<material name="kitchen_background_hot_pot" reflectance="0.5" rgba="0.4 0.4 0.4 1.0" />
<mesh file="kitchen_background_hot_pot/visual/kitchen_background_hot_pot_vis.msh" name="kitchen_background_hot_pot_vis" scale="0.01 0.01 0.01"/>

<texture file="kitchen_background_stove/kitchen_background_stove.png" name="tex-kitchen_background_stove" type="2d"/>
<material name="kitchen_background_stove" reflectance="0.5" texrepeat="1 1" texture="tex-kitchen_background_stove" texuniform="false"/>
<mesh file="kitchen_background_stove/visual/kitchen_background_stove_vis.msh" name="kitchen_background_stove_vis" scale="0.01 0.01 0.01"/>

<texture file="fridge/metal.png" name="tex-kitchen_background_fridge" type="2d"/>
<material name="kitchen_background_fridge" reflectance="0.9" texrepeat="1 1" texture="tex-kitchen_background_fridge" texuniform="false"/>
<mesh file="fridge/visual/fridge_vis.msh" name="kitchen_background_fridge_vis" scale="0.01 0.01 0.01"/>

</asset>
<worldbody>
<!-- Floor -->
<geom condim="3" group="1" material="floorplane" name="floor" pos="0 0 0" size="3 3 .125" type="plane"/>
<geom pos="-1.65 0.0 0.90" quat="0 0 0 1" type="mesh" mesh="kitchen_background_stove_vis" conaffinity="0" contype="0" group="1" material="kitchen_background_stove"/>
<geom pos="-1.50 0.23 0.93" quat="0.30 0 0 0.90" type="mesh" mesh="kitchen_background_hot_pot_vis" conaffinity="0" contype="0" group="1" material="kitchen_background_hot_pot"/>
<geom pos="-1.85 -0.85 0.90" quat="0 0 0 1" type="mesh" mesh="kitchen_background_pot_vis" conaffinity="0" contype="0" group="1" material="kitchen_background_pot"/>
<geom pos="-1.75 -2.4 0" quat="0 0 0 1" type="mesh" mesh="kitchen_background_fridge_vis" conaffinity="0" contype="0" group="1" material="kitchen_background_fridge"/>
<geom pos="-1.65 0.0 0.0" quat="0 0 0 1" type="mesh" mesh="kitchen_background_vis" conaffinity="0" contype="0" group="1" material="kitchen_background"/>

<light name="light_kitchen" diffuse=".8 .8 .8" dir="0 0 -1" directional="true" pos="-1.75 0 1.6" specular="0.8 0.8 0.8" castshadow="false"/>

<!-- <geom pos="-1.25 2.25 1.5" quat="0.6532815 0.6532815 0.2705981 0.2705981" size="1.06 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_leftcorner_visual" material="walls_mat"/>
<geom pos="-1.25 -2.25 1.5" quat="0.6532815 0.6532815 -0.2705981 -0.2705981" size="1.06 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_rightcorner_visual" material="walls_mat"/> -->
<geom pos="0.5 3 1.5" quat="0.7071 0.7071 0 0" size="2.5 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_left_visual" material="walls_mat"/>
<geom pos="0.5 -3 1.5" quat="0.7071 -0.7071 0 0" size="2.5 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_right_visual" material="walls_mat"/>
<geom pos="-2 0 1.5" quat="0.5 0.5 0.5 0.5" size="3 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_rear_visual" material="walls_mat"/>
<geom pos="3 0 1.5" quat="0.5 0.5 -0.5 -0.5" size="3 1.5 0.01" type="box" conaffinity="0" contype="0" group="1" name="wall_front_visual" material="walls_mat"/>
<!-- Table body -->
<body name="table" pos="0 0 0.4">
<geom pos="0 0 0" size="0.4 0.4 0.4" type="box" group="0" name="table_collision" friction="1 0.005 0.0001"/>
<geom pos="0 0 0" size="0.4 0.4 0.4" type="box" conaffinity="0" contype="0" group="1" name="table_visual" material="table_texture"/>
<site pos="0 0 0.4" name="table_top" size="0.001 0.001 0.001" rgba="0 0 0 0"/>
<!-- Legs (visual only) -->
<geom pos="0 0 0" size="0.05 0.1" type="cylinder" conaffinity="0" contype="0" group="1" name="table_leg1_visual" material="table_legs"/>
<geom pos="0 0 0" size="0.05 0.1" type="cylinder" conaffinity="0" contype="0" group="1" name="table_leg2_visual" material="table_legs"/>
<geom pos="0 0 0" size="0.05 0.1" type="cylinder" conaffinity="0" contype="0" group="1" name="table_leg3_visual" material="table_legs"/>
<geom pos="0 0 0" size="0.05 0.1" type="cylinder" conaffinity="0" contype="0" group="1" name="table_leg4_visual" material="table_legs"/>
</body>

<light name="light1" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="1 1 4.0" specular="0.3 0.3 0.3" castshadow="true"/>
<light name="light2" diffuse=".8 .8 .8" dir="0 -.15 -1" directional="false" pos="-3. -3. 4.0" specular="0.3 0.3 0.3" castshadow="true"/>

<!-- front view -->
<camera mode="fixed" name="frontview" pos="1.0 0 1.45" quat="0.56 0.43 0.43 0.56"/>
<!-- bird view -->
<camera mode="fixed" name="birdview" pos="-0.2 0 3.0" quat="0.7071 0 0 0.7071"/>
<!-- agent view -->
<camera mode="fixed" name="agentview" pos="0.5 0 1.35" quat="0.653 0.271 0.271 0.653"/>

<!-- side view -->
<camera mode="fixed" name="sideview" pos="-0.05651774593317116 1.2761224129427358 1.4879572214102434" quat="0.009905065491771751 0.006877963156909582 0.5912228352893879 0.806418094001364" />
</worldbody>
</mujoco>
Loading