File size: 978 Bytes
22e510a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
---
task_categories:
- robotics
---
## bridge dataset
version `1.0.0` consists of 60K trajectories in RLDS format
To use:
```py
import tensorflow_datasets as tfds
import tqdm
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--rlds_dir", type=str, default="bridge_data/1.0.0")
args = parser.parse_args()
ds_builder = tfds.builder_from_directory(args.rlds_dir)
dataset = ds_builder.as_dataset(split='all')
ds_length = len(dataset)
dataset = dataset.take(ds_length)
it = iter(dataset)
for i in tqdm.tqdm(range(ds_length)):
episode = next(it)
print("episode: ", i)
steps = episode['steps']
print("key in a traj: ", episode.keys())
for j, step in enumerate(steps):
# print(step['observation'].keys())
print(f" [step {j}] action: ", step["action"])
print(f" [step {j}] state: ", step['observation']['state'])
```
|