Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions navsim/planning/training/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,18 @@ def _load_scene_with_token(self, idx) -> Tuple[Dict[str, torch.Tensor], Dict[str
"""
token = self.tokens[idx]
token_path = self._valid_cache_paths[token]
if 'training_cache' in str(token_path):
pdm_token_path = str(token_path).replace("training_cache", "train_pdm_cache")
pdm_token_path_parts = pdm_token_path.split('/')
pdm_token_path_parts.insert(-1, 'unknown')
pdm_token_path = '/'.join(pdm_token_path_parts) + "/metric_cache.pkl"
else:
pdm_token_path = token_path
token_path_str = str(token_path)
if 'training_cache' in token_path_str:
pdm_token_path = token_path_str.replace(
"training_cache", "train_pdm_cache"
)
else:
pdm_token_path = token_path_str

pdm_token_path_parts = pdm_token_path.split('/')
pdm_token_path_parts.insert(-1, 'unknown')
pdm_token_path = '/'.join(pdm_token_path_parts) + "/metric_cache.pkl"


features: Dict[str, torch.Tensor] = {}
for builder in self._feature_builders:
Expand Down