huggingface / huggingface/robotics-course

Unit 1.4 example code error (StreamingLeRobotDataset not implemented "__get_item__")

Open
#18 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
152
Forks
31
PR merge metrics
No merged PRs in 30d

Description

when running code below, I encountered the error
```python
"---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[11], [line 18](vscode-notebook-cell:?execution_count=11&line=18)
12 streaming_dataset = StreamingLeRobotDataset(
13 "lerobot/svla_so101_pickplace",
14 delta_timestamps=delta_timestamps
15 )
17 # Works exactly like regular dataset
---> [18](vscode-notebook-cell:?execution_count=11&line=18) sample = streaming_dataset[100]

File ~/opt/anaconda3/envs/arm-mujoco/lib/python3.10/site-packages/torch/utils/data/dataset.py:59, in Dataset.__getitem__(self, index)
58 def __getitem__(self, index) -> _T_co:
---> [59](https://file+.vscode-resource.vscode-cdn.net/Users/berkerqiao/Library/CloudStorage/OneDrive-%E4%B8%AA%E4%BA%BA/02_Research/01-Projects/01_AIF_mainipulator/07_LeRobot/~/opt/anaconda3/envs/arm-mujoco/lib/python3.10/site-packages/torch/utils/data/dataset.py:59) raise NotImplementedError("Subclasses of Dataset should implement __getitem__.")

NotImplementedError: Subclasses of Dataset should implement __getitem__."
```

code:
``` python
"from lerobot.datasets.streaming_dataset import StreamingLeRobotDataset

# Predict multiple future actions at once
delta_timestamps = {
"observation.images.up": [0.0], # Recent + current
"action": [0.0, 0.1, 0.2, 0.3] # Current + 3 future actions
}

from lerobot.datasets.streaming_dataset import StreamingLeRobotDataset

# Stream data without downloading
streaming_dataset = StreamingLeRobotDataset(
"lerobot/svla_so101_pickplace",
delta_timestamps=delta_timestamps
)

# Works exactly like regular dataset
sample = streaming_dataset[100]"
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.