KITTI_Tutorial icon indicating copy to clipboard operation
KITTI_Tutorial copied to clipboard

TypeError: 'generator' object has no attribute '__getitem__'

Open keishatsai opened this issue 6 years ago • 1 comments

Hi, Here is what I have encountered when I run the code which you provided "Project 3D Velodyne points to 2D camera Image ", I got error message. I put the code you provided in ipython notebook inside one file called, "projectVelo.py", and I only changed the path to velodyne and image file.

Here is the error message:

Traceback (most recent call last): File "projectVelo.py", line 60, in img, pnt, c_ = res.velo_projection_frame(v_fov=v_fov, h_fov=h_fov) File "/home/keisha_tsai/Downloads/KITTI_Tutorial-master/kitti_foundation.py", line 611, in velo_projection_frame res, c_ = self.__velo_2_img_projection(velo_gen) File "/home/keisha_tsai/Downloads/KITTI_Tutorial-master/kitti_foundation.py", line 486, in _velo_2_img_projection xyz_v, c = self.__point_matrix(points) File "/home/keisha_tsai/Downloads/KITTI_Tutorial-master/kitti_foundation.py", line 305, in __point_matrix self.__points_filter(points) File "/home/keisha_tsai/Downloads/KITTI_Tutorial-master/kitti_foundation.py", line 368, in __points_filter self.__upload_points(points) File "/home/keisha_tsai/Downloads/KITTI_Tutorial-master/kitti_foundation.py", line 296, in __upload_points self.__x = points[:, 0] TypeError: 'generator' object has no attribute 'getitem'

Hope anyone can help me to solve this problem. Thank you.

keishatsai avatar Jan 17 '18 05:01 keishatsai

The problem didn't occur when I used the code which provided in "velo2cam_projection_detail.ipynb". Still don't know why, but at least I can get the proper result.

keishatsai avatar Jan 18 '18 03:01 keishatsai