Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nuScenes dataparser compatible with ParallelDataManager #2635

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

dmholtz
Copy link
Contributor

@dmholtz dmholtz commented Nov 29, 2023

The ParallelDataManager (see #2092) makes pytorch crash if the cameras instance's fx, fy, cx or cy tensors are loaded from a common shared tensor.

This PR fixes the issue by cloning the respective tensors before passing them to the Cameras(...) constructor.

@dmholtz dmholtz force-pushed the fix/nuscenes-parser branch from a405377 to c86e210 Compare November 29, 2023 12:49
fx=intrinsics[:, 0, 0].detach().clone(),
fy=intrinsics[:, 1, 1].detach().clone(),
cx=intrinsics[:, 0, 2].detach().clone(),
cy=intrinsics[:, 1, 2].detach().clone(),
height=900,
width=1600,
camera_to_worlds=poses[:, :3, :4],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also do this on the transform matrices?

Copy link
Contributor Author

@dmholtz dmholtz Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is not necessary, because the data in poses is not shared across multiple parameters contrary to fx, fy, cx, cy of the tensor intrinsics.

With my fix applied, ns-train nerfacto nuscenes-data --data ... --data_dir ... runs as expected.

@dmholtz dmholtz force-pushed the fix/nuscenes-parser branch from c86e210 to ffdc8b5 Compare November 29, 2023 20:25
The ParallelDataManager (see nerfstudio-project#2092) makes pytorch crash if the cameras instance's fx, fy, cx or cy tensors
are loaded from a common shared tensor.

This PR fixes the issue by cloning the respective tensors before passing them to the Cameras(...) constructor.
@dmholtz dmholtz force-pushed the fix/nuscenes-parser branch from ffdc8b5 to f926c99 Compare November 30, 2023 06:25
@dmholtz
Copy link
Contributor Author

dmholtz commented Nov 30, 2023

When will this PR get merged? I rebased the contribution to the latest main to have a clean history.

@brentyi brentyi merged commit 3d8af87 into nerfstudio-project:main Nov 30, 2023
4 checks passed
@dmholtz dmholtz deleted the fix/nuscenes-parser branch December 1, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants