nv-tlabs / NKSR

[CVPR 2023 Highlight] Neural Kernel Surface Reconstruction
https://research.nvidia.com/labs/toronto-ai/NKSR
Other
735 stars 43 forks source link

reconstructor error? mat1 and mat2 must have the same dtype #61

Closed zhouilu closed 8 months ago

zhouilu commented 8 months ago
>>> input_xyz = torch.from_numpy(np.asarray(pcd.points)).to(device)
>>> input_color = torch.from_numpy(np.asarray(pcd.colors)).to(device)
>>> input_normal = torch.from_numpy(np.asarray(pcd.normals)).to(device)
>>>
>>> print(input_xyz.shape, input_normal.shape, input_color.shape)
torch.Size([2779426, 3]) torch.Size([2779426, 3]) torch.Size([2779426, 3])
>>>
>>> reconstructor = nksr.Reconstructor(device)
>>> # reconstructor.chunk_tmp_device = torch.device("cpu")
>>> # Note that input_xyz and input_normal are torch tensors of shape [N, 3] and [N, 3] respectively.
>>> field = reconstructor.reconstruct(input_xyz, input_normal)
12-27 03:20:57 (__init__.py:230) [INFO] Input scale factor: 0.2236
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.10/site-packages/nksr/__init__.py", line 255, in reconstruct
    feat = self.network.encoder(xyz, feat, svh, 0)
  File "/home/user/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/nksr/nn/encdec.py", line 102, in forward
    pts_feature = self.fc_pos(torch.cat([pts_xyz, pts_feature], dim=1))
  File "/home/user/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/torch/nn/modules/linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: mat1 and mat2 must have the same dtype

can you give me some advice? thanks

zhouilu commented 8 months ago

torch type reason, close it