qcraftai / pillar-motion

Self-Supervised Pillar Motion Learning for Autonomous Driving (CVPR 2021)
Other
118 stars 13 forks source link

optf[cam_id == cid, :2] = flo[cam_coord[cam_id == cid, 1].astype(np.int32), points[cam_id == cid, 0].astype(np.int32)] IndexError: index 1147174912 is out of bounds for axis 0 with size 900 #8

Closed liangchunlan closed 2 years ago

liangchunlan commented 2 years ago

I installed the PWC-DC network according to https://github.com/NVlabs/PWC-Net. When I ran “python tools/create_data nuscenes_data_prep --root_path /path/to/nuscenes” command, I encountered the following problems.

Traceback (most recent call last): File "motion/datasets/nuscenes/flow.py", line 654, in res = save_flow(info, root_path) File "motion/datasets/nuscenes/flow.py", line 638, in save_flow optf[cam_id == cid, :2] = flo[cam_coord[cam_id == cid, 1].astype(np.int32), points[cam_id == cid, 0].astype(np.int32)] IndexError: index 1147174912 is out of bounds for axis 0 with size 900

========================================== The following are some variables I checked, which are really out of range. I hope you can help me. Thank you very much.

print(points.shape)

# (34720, 5)
# print(optf.shape)
# (34720, 3)
print(cam_coord)
"""
[[-1082130432 -1082130432]
 [-1082130432 -1082130432]
 [-1082130432 -1082130432]
 ...
 [ 1150836736  1133019136]
 [ 1150844928  1131479040]
 [ 1150861312  1129316352]]
"""
    # print(cam_id.shape)
    # (34720,)
    # print(flo.shape)
    # (900, 1600, 2)
    # print(cam_coord.shape)
    # (34720, 2)
    # print(points.shape)
    # (34720, 5)
    # print(cam_coord[cam_id == cid, 1])
    # [1147174912 1147158528 1146519552 ... 1129381888 1146650624 1146044416]
    # print(cam_coord[cam_id == cid, 1].astype(np.int32).shape)
    # (2516,)
    # print(cam_coord[cam_id == cid, 1].astype(np.int32))
    # [1147174912 1147158528 1146519552... 1129381888 1146650624 1146044416]
ajinkyakhoche commented 2 years ago

When reading cam_coord in save_flow(), instead of cam_coord = np.fromfile(info['cam_coords'], dtype=np.int32).reshape([-1, 2]) try cam_coord = np.fromfile(info['cam_coords'], dtype=np.float32).astype(np.int16).reshape([-1, 2])

chenxuluo commented 2 years ago

sorry for the bug. fixed.