Pointcept icon indicating copy to clipboard operation
Pointcept copied to clipboard

ValueError in z_order_decode due to mismatched return values from key2xyz

Open Tgmmmmmmmm opened this issue 5 months ago • 1 comments

Bug Description​ The function key2xyz in pointcept/models/utils/serialization/z_order.py returns 4 values (x, y, z, b), but z_order_decode in pointcept/models/utils/serialization/default.py only accepts 3 values (x, y, z), causing ValueError: too many values to unpack (expected 3).

​Steps to Reproduce​

  1. Call z_order_decode(code, depth)
  2. Internally calls z_order_decode_ (which eventually calls key2xyz)
  3. Throws ValueError due to return value count mismatch

​Expected Behavior

  1. z_order_decode should properly handle all return values from key2xyz, or
  2. key2xyz should only return x, y, z (if b is not needed)

Suggested Fix​ Modify z_order_decode to accept b (even if unused):

def z_order_decode(code: torch.Tensor, depth):
    x, y, z, b = z_order_decode_(code, depth=depth)
    grid_coord = torch.stack([x, y, z], dim=-1)
    return grid_coord

Tgmmmmmmmm avatar Jul 23 '25 06:07 Tgmmmmmmmm

Note: The decode function for serialization appears not to have been directly utilized in this project.

Tgmmmmmmmm avatar Jul 23 '25 06:07 Tgmmmmmmmm

Sorry for the late response. Thank you for let me know. Do you mind to open a PR to fix this issue?

Gofinge avatar Dec 03 '25 08:12 Gofinge