Skip to content

Commit 2fdba24

Browse files
committed
move images to device properly
1 parent 0012017 commit 2fdba24

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nerfstudio/data/utils/dataloaders.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,12 @@ def __iter__(self):
631631
camera, data = self.custom_view_processor(camera, data)
632632

633633
i += 1
634+
camera = camera.to(self.device)
635+
data['image'] = data['image'].to(self.device)
636+
if 'mask' in data:
637+
data['mask'] = data['mask'].to(self.device)
638+
if 'depth_image' in data:
639+
data['depth_image'] = data['depth_image'].to(self.device)
634640
yield camera, data
635641

636642

0 commit comments

Comments
 (0)