Pointcept
Pointcept copied to clipboard
ValueError in z_order_decode due to mismatched return values from key2xyz
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
- Call z_order_decode(code, depth)
- Internally calls z_order_decode_ (which eventually calls key2xyz)
- Throws ValueError due to return value count mismatch
Expected Behavior
- z_order_decode should properly handle all return values from key2xyz, or
- 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
Note: The decode function for serialization appears not to have been directly utilized in this project.
Sorry for the late response. Thank you for let me know. Do you mind to open a PR to fix this issue?