google-research / nerf-from-image

Shape, Pose, and Appearance from a Single Image via Bootstrapped Radiance Field Inversion
Apache License 2.0
381 stars 18 forks source link

Error when inference using custom images #6

Open bdfbdf321 opened 1 year ago

bdfbdf321 commented 1 year ago

Traceback (most recent call last): File "run.py", line 32, in from lib import nerf_utils File "/home//github/nerf-from-image/lib/nerf_utils.py", line 29, in def get_ray_bundle(height: int, File "/home//anaconda3/envs/mask2former/lib/python3.8/site-packages/torch/jit/_script.py", line 1143, in script fn = torch._C._jit_script_compile( RuntimeError:

aten::meshgrid(Tensor[] tensors) -> (Tensor[]): Keyword argument indexing unknown. : File "/home/*/github/nerf-from-image/lib/nerf_utils.py", line 36 center: Optional[torch.Tensor] = None):

ii, jj = torch.meshgrid(
         ~~~~~~~~~~~~~~ <--- HERE
    torch.arange(width, device=tform_cam2world.device) / width,
    torch.arange(height, device=tform_cam2world.device) / height,
dariopavllo commented 1 year ago

Hi, what version of PyTorch are you using?

bdfbdf321 commented 1 year ago

python 3.8 pytorch 1.9.0 cudatoolkits 11.1 torchvision 0.10.0 @dariopavllo

could you share your env with me?

bdfbdf321 commented 1 year ago

I update torch to 2.0.0 and the problem is solved~ thanks!

dariopavllo commented 1 year ago

Indeed, the PyTorch version was too old. At least 1.10 is required. Glad it was solved!

bdfbdf321 commented 1 year ago

Indeed, the PyTorch version was too old. At least 1.10 is required. Glad it was solved!

Thanks for reply. I wonder that whether inference could run on single GPU (16GB). Also, how long will python run.py --resume_from g_cub_pretrained --inv_export_demo_sample --gpus 4 --batch_size 16 take for demo ? (it300000) Is it necessary to run 300000 iterations again using pre-trained model to get one image result?