Skip to content

fix: workaround PyTorch 2.6 torch.load incompatibility in ns-export - #222

Merged
crowecawcaw merged 2 commits into
aws-deadline:mainlinefrom
anika-suman-amazon:fix/pytorch-2.6-ns-export-workaround-clean
May 19, 2026
Merged

fix: workaround PyTorch 2.6 torch.load incompatibility in ns-export#222
crowecawcaw merged 2 commits into
aws-deadline:mainlinefrom
anika-suman-amazon:fix/pytorch-2.6-ns-export-workaround-clean

Conversation

@anika-suman-amazon

Copy link
Copy Markdown
Contributor

Fixes: nerfstudio-project/nerfstudio#3711

What was the problem/requirement? (What/Why)

NeRF Studio's ns-export fails on PyTorch 2.6+ because torch.load now defaults to weights_only=True, rejecting numpy globals in the checkpoint file.

What was the solution? (How)

Monkey-patch torch.load with weights_only=False before calling the exporter, by invoking ns-export from within Python instead of as a shell command.

What is the impact of this change?

The NERFSTUDIO (splatfacto) trainer now produces a .ply file end-to-end when using the conda-forge nerfstudio package with PyTorch 2.6+.

How was this change tested?

Submitted the gsplat_pipeline job to a Deadline Cloud farm with a g5.4xlarge GPU fleet. Verified the full pipeline completes successfully: frame extraction, SfM solve, training (30,000 steps), and .ply export. Downloaded and viewed the output in SuperSplat.

Was this change documented?

Yes. Added a "Known issues" subsection to the README documenting the PyTorch 2.6 workaround, the custom package requirement for GSPLAT_SIMPLE_TRAINER/NERFSTUDIO_SPLATFACTOW, and simplified prerequisites for the default trainer.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: Anika Suman <anika-suman-amazon@users.noreply.github.com>
@anika-suman-amazon
anika-suman-amazon requested a review from a team as a code owner May 15, 2026 18:09
@github-actions github-actions Bot added the waiting-on-maintainers Waiting on the maintainers to review. label May 15, 2026
@crowecawcaw
crowecawcaw enabled auto-merge (squash) May 19, 2026 19:44
@crowecawcaw
crowecawcaw merged commit 1c92c30 into aws-deadline:mainline May 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on-maintainers Waiting on the maintainers to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants