torch-ngp icon indicating copy to clipboard operation
torch-ngp copied to clipboard

GridEncoder raises a new error

Open Xallt opened this issue 2 years ago • 1 comments

@ashawkey this may or may not be related to https://github.com/ashawkey/torch-ngp/issues/96 Using the GridEncoder from the latest commit in any way (for example, this)

enc = GridEncoder(input_dim=3)
enc(torch.rand(3))

results in this error

TypeError: grid_encode_forward(): incompatible function arguments. The following argument types are supported:
    1. (arg0: at::Tensor, arg1: at::Tensor, arg2: at::Tensor, arg3: at::Tensor, arg4: int, arg5: int, arg6: int, arg7: int, arg8: float, arg9: int, arg10: bool, arg11: at::Tensor, arg12: int) -> None

Invoked with: tensor([[0.9357, 0.9708, 0.6478]]), Parameter containing:
tensor([[ 6.9069e-06,  8.2141e-05],
        [ 1.3035e-05,  2.1198e-05],
        [ 9.4285e-05,  2.7067e-05],
        ...,
        [ 6.2388e-05,  2.0390e-05],
        [ 4.3973e-05, -4.3807e-05],
        [ 1.6104e-05, -3.5813e-05]], device='cuda:0', requires_grad=True), tensor([     0,   4920,  37688,  70456, 103224, 135992, 168760, 201528, 234296,
        267064, 299832, 332600, 365368, 398136, 430904, 463672, 496440],
       device='cuda:0', dtype=torch.int32), tensor([[[-2.9651e-17,  3.0913e-41]],

        [[ 8.2266e-33,  4.5894e-41]],

        [[ 8.9683e-44,  0.0000e+00]],

        [[ 1.1210e-43,  0.0000e+00]],

        [[-2.7219e-17,  3.0913e-41]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 1.4013e-45,  0.0000e+00]],

        [[ 0.0000e+00,  0.0000e+00]],

        [[ 1.5835e-43,  0.0000e+00]],

        [[-7.7134e-17,  3.0913e-41]],

        [[-8.8704e-17,  3.0913e-41]]]), 1, 3, 2, 16, 1.0, 16, False, tensor([8.2267e-33]), 0, False

Xallt avatar Aug 11 '22 17:08 Xallt

@Xallt Hi, don't forget to reinstall the extension after updating the code? I got the following results with the latest commit:

In [7]: enc = GridEncoder(input_dim=3).cuda()
   ...: enc(torch.rand(3).cuda())
Out[7]: 
tensor([-1.7676e-05,  6.0067e-05, -3.0194e-05, -6.4224e-05,  2.3444e-05,
        -4.5093e-06, -2.5045e-05, -2.2426e-06,  3.6231e-05,  7.0506e-05,
        -7.5938e-06, -2.1525e-05,  6.0705e-05, -4.5846e-05,  6.8714e-05,
         5.5613e-07, -5.3141e-05, -1.2201e-05,  5.9143e-05,  2.2793e-05,
         3.8771e-05,  7.7599e-07,  1.6171e-05,  5.9737e-06, -5.1140e-05,
        -1.0533e-05,  4.9593e-05, -1.9146e-05, -1.5490e-05, -4.7555e-05,
        -4.1738e-05,  3.0990e-05], device='cuda:0', grad_fn=<ViewBackward>)

ashawkey avatar Aug 12 '22 01:08 ashawkey

Oh my bad, this was a mistake on my part, thanks

Xallt avatar Aug 12 '22 07:08 Xallt