Skip to content

fix: resample training images in FlexibleDataManager - #19

Merged
hummat merged 1 commit into
mainfrom
fix/flexible-datamanager-resample
Jul 6, 2026
Merged

hummat merged 1 commit into
mainfrom
fix/flexible-datamanager-resample

Conversation

@hummat

@hummat hummat commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

FlexibleDataManagerConfig forces train_num_images_to_sample_from=1 but inherits train_num_times_to_repeat_images=-1 from VanillaDataManagerConfig. In CacheDataloader that combination caches one randomly chosen training image at startup and never resamples another, so any method on this config trains against a single view. Affected methods: geo-neus, geo-volsdf, geo-unisurf.

Closes: #18

Changes

  • Default FlexibleDataManagerConfig.train_num_times_to_repeat_images to 0, so a new single image is resampled every iteration instead of caching one forever.
  • Document why train_num_images_to_sample_from is pinned to 1 (each batch is one reference image plus its source views in FlexibleDataManager.next_train).
  • Turn the CacheDataloader "without resampling" message into a warning, so the same footgun is loud for any other config that sets num_times_to_repeat_images=-1 with a subset of images.
  • Add tests/data/test_dataloaders.py covering the resampling behaviour and the corrected config default.

Type of Change

  • Bug fix

Testing

  • Ran sdf-dev-test (required)
  • Added/updated tests
  • Tested training manually

Ran on the changed files (full sdf-dev-test blocked locally by the tinycudann GPU build):

  • uv run --no-sync ruff format --check + ruff check — pass
  • uv run --no-sync pyright sdfstudio/... — 0 errors
  • uv run --no-sync pytest tests/data/test_dataloaders.py — 3 passed

Checklist

  • My code follows the existing style (ruff format + pyright)
  • I have updated documentation if needed

FlexibleDataManagerConfig forces train_num_images_to_sample_from=1 but
inherited train_num_times_to_repeat_images=-1 from VanillaDataManagerConfig,
so CacheDataloader cached a single training image at startup and never
rotated to another. Methods built on this config (geo-neus, geo-volsdf,
geo-unisurf) overfit one view by default.

Default train_num_times_to_repeat_images to 0 so a new single image is
resampled every iteration, and turn the "without resampling" dataloader
message into a warning so the same footgun is loud for any other config
hitting it.

Closes #18
@hummat hummat added bug Something isn't working training Training models labels Jul 5, 2026
@hummat
hummat merged commit 12a3f75 into main Jul 6, 2026
11 checks passed
@hummat
hummat deleted the fix/flexible-datamanager-resample branch July 6, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working training Training models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlexibleDataManagerConfig defaults forces training on a single image

1 participant