We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, the function cameras_from_opencv_projection instantiates cameras on the CPU side when provided with GPU tensors.
cameras_from_opencv_projection
I believe that passing an additional parameter device=R.device to the following constructor should solve the issue:
device=R.device
pytorch3d/pytorch3d/renderer/camera_conversions.py
Line 52 in 741777b
Best, Romain
import torch import pytorch3d.utils device = torch.device(0) R = torch.eye(3, device=device)[None] tvec = torch.zeros(1, 3, device=device) camera_matrix = torch.eye(3, device=device)[None] image_size = torch.as_tensor([[320, 240]], device=device) cameras = pytorch3d.utils.cameras_from_opencv_projection(R=R, tvec=tvec, camera_matrix=camera_matrix, image_size=image_size) print("Input device", R.device) print("Output device", cameras.R.device)
Output:
Input device cuda:0 Output device cpu
(expected output: cuda:0)
The text was updated successfully, but these errors were encountered:
cameras_from_opencv_projection device #1021
45d096e
Summary: Fix #1021 that cameras_from_opencv_projection always creates on CPU. Reviewed By: nikhilaravi Differential Revision: D33508211 fbshipit-source-id: fadebd45cacafd633af6a58094cf6f654529992c
No branches or pull requests
🐛 Bugs / Unexpected behaviors
Hi,
the function
cameras_from_opencv_projection
instantiates cameras on the CPU side when provided with GPU tensors.I believe that passing an additional parameter
device=R.device
to the following constructor should solve the issue:pytorch3d/pytorch3d/renderer/camera_conversions.py
Line 52 in 741777b
Best,
Romain
Instructions To Reproduce the Issue:
Output:
(expected output: cuda:0)
The text was updated successfully, but these errors were encountered: