mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 06:49:13 +08:00
Delete useless lists of tensors put to CUDA which may cause OOM. (#1748)
eval_large_imgs
This commit is contained in:
1 parent
e48468cfae
commit
ce733a8308
1 file changed
+3
-3
@@ -177,12 +177,12 @@ class Model(nn.Module):
|
|||||||
ray_bundle = camera_ray_bundle.get_row_major_sliced_ray_bundle(start_idx, end_idx)
|
ray_bundle = camera_ray_bundle.get_row_major_sliced_ray_bundle(start_idx, end_idx)
|
||||||
outputs = self.forward(ray_bundle=ray_bundle)
|
outputs = self.forward(ray_bundle=ray_bundle)
|
||||||
for output_name, output in outputs.items(): # type: ignore
|
for output_name, output in outputs.items(): # type: ignore
|
||||||
|
if not torch.is_tensor(output):
|
||||||
|
# TODO: handle lists of tensors as well
|
||||||
|
continue
|
||||||
outputs_lists[output_name].append(output)
|
outputs_lists[output_name].append(output)
|
||||||
outputs = {}
|
outputs = {}
|
||||||
for output_name, outputs_list in outputs_lists.items():
|
for output_name, outputs_list in outputs_lists.items():
|
||||||
if not torch.is_tensor(outputs_list[0]):
|
|
||||||
# TODO: handle lists of tensors as well
|
|
||||||
continue
|
|
||||||
outputs[output_name] = torch.cat(outputs_list).view(image_height, image_width, -1) # type: ignore
|
outputs[output_name] = torch.cat(outputs_list).view(image_height, image_width, -1) # type: ignore
|
||||||
return outputs
|
return outputs
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user