Skip to content

Commit c86e210

Browse files
committed
Make nuScenes dataparser compatible with ParallelDataManager
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.
1 parent c896ee4 commit c86e210

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nerfstudio/data/dataparsers/nuscenes_dataparser.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ def _generate_dataparser_outputs(self, split="train"):
200200
)
201201

202202
cameras = Cameras(
203-
fx=intrinsics[:, 0, 0],
204-
fy=intrinsics[:, 1, 1],
205-
cx=intrinsics[:, 0, 2],
206-
cy=intrinsics[:, 1, 2],
203+
fx=intrinsics[:, 0, 0].detach().clone(),
204+
fy=intrinsics[:, 1, 1].detach().clone(),
205+
cx=intrinsics[:, 0, 2].detach().clone(),
206+
cy=intrinsics[:, 1, 2].detach().clone(),
207207
height=900,
208208
width=1600,
209209
camera_to_worlds=poses[:, :3, :4],

0 commit comments

Comments
 (0)