Skip to content

Commit 37b7e04

Browse files
committed
add: LIBERO evaluation
1 parent 1fcc14d commit 37b7e04

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "evaluations/probe3d"]
55
path = evaluations/probe3d
66
url = https://github.com/HaoyiZhu/probe3d.git
7+
[submodule "evaluations/LIBERO"]
8+
path = evaluations/LIBERO
9+
url = https://github.com/HaoyiZhu/LIBERO.git

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,68 @@ Then, please follow the instructions in the [CortexBench README](https://github.
208208
3) To run the VC-1 evaluation for spa, specify the model config as a parameter (embedding=<spa_model>) for each of the benchmarks in [cortexbench](https://github.com/xiaoxiao0406/eai-vc/tree/main/cortexbench).
209209
</details>
210210

211+
<details>
212+
<summary><b>LIBERO Evaluation</b></summary>
213+
214+
Please first run `git submodule update --init --recursive`. Then install the LIBERO enviornment:
215+
216+
```console
217+
cd evaluations/LIBERO
218+
pip3 install -r requirements.txt
219+
pip3 install -e .
220+
```
221+
222+
Then you have to download LIBERO datasets:
223+
```console
224+
python benchmark_scripts/download_libero_datasets.py
225+
```
226+
227+
Then you can choose:
228+
229+
- `BENCHMARK` from `[LIBERO_SPATIAL, LIBERO_OBJECT, LIBERO_GOAL, LIBERO_90, LIBERO_10]`
230+
231+
then run the following:
232+
233+
```console
234+
export CUDA_VISIBLE_DEVICES=GPU_ID && \
235+
export MUJOCO_EGL_DEVICE_ID=GPU_ID && \
236+
python libero/lifelong/main.py seed=SEED \
237+
benchmark_name=BENCHMARK \
238+
policy=bc_transformer_policy \
239+
lifelong=multitask \
240+
policy/image_encoder=spa_encoder.yaml
241+
```
242+
Note that in SPA paper, we remove all the data augmentations since we aim to produce a simple and fair setting instead of training a SOTA policy. To do so, you could run the following:
243+
```console
244+
export CUDA_VISIBLE_DEVICES=GPU_ID && \
245+
export MUJOCO_EGL_DEVICE_ID=GPU_ID && \
246+
python libero/lifelong/main.py seed=SEED \
247+
benchmark_name=BENCHMARK \
248+
policy=bc_transformer_policy \
249+
lifelong=multitask \
250+
policy/image_encoder=spa_encoder.yaml \
251+
policy/data_augmentation@policy.color_aug=identity_aug.yaml \
252+
policy/data_augmentation@policy.translation_aug=identity_aug.yaml
253+
```
254+
> Actually, in SPA's experiments, for speed consideration, we use only 20 demos for each task. To do so, you may need to manually modify the datasets. Moreover, SPA only trains for 25 epochs.
255+
256+
257+
If you encounter this error, it is due to LIBERO's numpy version.
258+
```
259+
AttributeError: module 'numpy' has no attribute 'bool'.
260+
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
261+
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
262+
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
263+
```
264+
You can downgrade your numpy version:
265+
```console
266+
pip install "numpy<1.24"
267+
```
268+
269+
For more details, please refer to LIBERO's official documentation.
270+
271+
</details>
272+
211273
<details>
212274
<summary><b>Camera Pose Evaluation</b></summary>
213275

evaluations/LIBERO

Submodule LIBERO added at f9904ac

0 commit comments

Comments
 (0)