Skip to content

Fix scene_dataset being overwritten by episode config - #2234

Open
Functionhx wants to merge 1 commit into
facebookresearch:mainfrom
Functionhx:fix/scene-dataset-override
Open

Fix scene_dataset being overwritten by episode config#2234
Functionhx wants to merge 1 commit into
facebookresearch:mainfrom
Functionhx:fix/scene-dataset-override

Conversation

@Functionhx

Copy link
Copy Markdown

Fixes #2090

Problem

In Env.__init__, the simulator's scene_dataset was unconditionally overwritten with the current episode's scene_dataset_config. For HM3D InstanceImageNav and other semantic tasks, this broke semantics loading because the episode data carries a basic scene dataset config (e.g., "default" or hm3d_basis.scene_dataset_config.json) that lacks semantic annotation paths, overriding the user's semantic-aware config (e.g., hm3d_annotated_basis.scene_dataset_config.json).

Root Cause

The config's simulator.scene_dataset defaults to "default" (from default_structured_configs.py). The episode's scene_dataset_config also defaults to "default" (from dataset.py). When a user explicitly sets scene_dataset to a semantic config, the episode loading code would blindly overwrite it, causing the simulator to initialize without semantic annotations.

The resulting error manifests as warnings like:

The active scene does not contain semantic annotations : activeSemanticSceneID_ = 0

Fix

Only use the episode's scene_dataset_config as a fallback when the simulator config's scene_dataset is still set to its default value ("default"), indicating the user hasn't explicitly configured it. When the user provides an explicit scene_dataset path, that choice is now respected.

Change

habitat-lab/habitat/core/env.py: Added a guard if self._config.simulator.scene_dataset == "default": before overriding with the episode's config.

Testing

This is a minimal, targeted fix. The existing behavior is preserved when scene_dataset is "default" (no user override). The only change is that an explicitly configured scene_dataset is now respected instead of being silently overwritten.

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 9, 2026
In Env.__init__, the simulator's scene_dataset was unconditionally
overwritten with the current episode's scene_dataset_config. For HM3D
InstanceImageNav and other semantic tasks, this broke semantics loading
because the episode data carries a basic scene dataset config
(e.g., 'default' or 'hm3d_basis.scene_dataset_config.json') that lacks
semantic annotation paths, overriding the user's semantic-aware config
(e.g., 'hm3d_annotated_basis.scene_dataset_config.json').

The fix: only use the episode's scene_dataset_config as a fallback when
the simulator config's scene_dataset is still set to its default value
('default'), indicating the user hasn't explicitly configured it.
When the user provides an explicit scene_dataset path, that choice is
now respected.

Fixes facebookresearch#2090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Semantics aren't loading correctly (Hm3D, Instance Image Nav)

1 participant