Skip to content

can't use av2_motion_forecasting #53

@suannairen

Description

@suannairen

When I run the following python file, I get the following error

from collections import defaultdict
from torch.utils.data import DataLoader
from tqdm import tqdm

from trajdata import AgentBatch, AgentType, UnifiedDataset
from trajdata.augmentation import NoiseHistories
from trajdata.visualization.vis import plot_agent_batch
def main():
noise_hists = NoiseHistories()

dataset = UnifiedDataset(
    desired_data=["av2_motion_forecasting-val"],
    centric="agent",
    desired_dt=0.1,
    history_sec=(5, 5),
    future_sec=(6, 6),
    only_predict=[AgentType.VEHICLE],
    agent_interaction_distances=defaultdict(lambda: 30.0),
    incl_robot_future=False,
    incl_raster_map=True,
    raster_map_params={
        "px_per_m": 2,
        "map_size_px": 224,
        "offset_frac_xy": (-0.5, 0.0),
    },
    augmentations=[noise_hists],
    num_workers=0,
    verbose=True,
    data_dirs={  # Remember to change this to match your filesystem!
         "av2_motion_forecasting": "/media/znr/Z/traj_dataset/argoverse2",
    },
)

print(f"# Data Samples: {len(dataset):,}")

dataloader = DataLoader(
    dataset,
    batch_size=4,
    shuffle=True,
    collate_fn=dataset.get_collate_fn(),
    num_workers=4,
)

batch: AgentBatch
for batch in tqdm(dataloader):
    plot_agent_batch(batch, batch_idx=0)

if name == "main":
main()

python examples/batch_example.py
Loading data for matched scene tags: ['val-av2_motion_forecasting']
Getting Scenes from av2_motion_forecasting: 100%|████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 11.25it/s]
Calculating Agent Data (Serially): 100%|████████████████████████████████████████████████████████████████| 3201/3201 [00:00<00:00, 82669.67it/s]
3201 scenes in the scene index.
Creating Agent Data Index (Serially): 100%|██████████████████████████████████████████████████████████████| 3201/3201 [00:01<00:00, 2342.61it/s]
Traceback (most recent call last):
File "/home/znr/my_app/abnormal_detect/examples/batch_example.py", line 53, in
main()
File "/home/znr/my_app/abnormal_detect/examples/batch_example.py", line 14, in main
dataset = UnifiedDataset(
File "/home/znr/my_app/trajdata/src/trajdata/dataset.py", line 375, in init
AgentDataIndex(data_index, self.verbose)
File "/home/znr/my_app/trajdata/src/trajdata/data_structures/data_index.py", line 50, in init
super().init(data_index)
File "/home/znr/my_app/trajdata/src/trajdata/data_structures/data_index.py", line 22, in init
scene_paths, full_index_len, _ = zip(*data_index)
ValueError: not enough values to unpack (expected 3, got 0)

But if I load the nuscene data it does work,how can I solve it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions