Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: tuple indices must be integers or slices, not str #21

Closed
azooz95 opened this issue Sep 26, 2022 · 5 comments
Closed

TypeError: tuple indices must be integers or slices, not str #21

azooz95 opened this issue Sep 26, 2022 · 5 comments

Comments

@azooz95
Copy link

azooz95 commented Sep 26, 2022

Thank you for your remarkable efforts.

I am running the test file for inference, however i am getting typeError as following:
Traceback (most recent call last):
File "/home/azooz/Downloads/PointPillars/test.py", line 138, in
main(args)
File "/home/azooz/Downloads/PointPillars/test.py", line 83, in main
result_filter = keep_bbox_from_lidar_range(result_filter, pcd_limit_range)
File "/home/azooz/Downloads/PointPillars/utils/process.py", line 592, in keep_bbox_from_lidar_range
lidar_bboxes = result['lidar_bboxes']
TypeError: tuple indices must be integers or slices, not str

Thank you in advance.

@RunTian1
Copy link

Thank you for your remarkable efforts.

I am running the test file for inference, however i am getting typeError as following: Traceback (most recent call last): File "/home/azooz/Downloads/PointPillars/test.py", line 138, in main(args) File "/home/azooz/Downloads/PointPillars/test.py", line 83, in main result_filter = keep_bbox_from_lidar_range(result_filter, pcd_limit_range) File "/home/azooz/Downloads/PointPillars/utils/process.py", line 592, in keep_bbox_from_lidar_range lidar_bboxes = result['lidar_bboxes'] TypeError: tuple indices must be integers or slices, not str

Thank you in advance.

I have encountered this problem before. The main reason is that the pillars returned by PillarsLayer had a value of 0, which was later used as the denominator when computing the center point in PillarEncoder, resulting in nan results. Find the part of pillars with a value of 0 to solve it

@zhulf0804
Copy link
Owner

Hello @azooz95,

Did you modify the original code? I find line 592 in file "PointPillars/utils/process.py" is not lidar_bboxes = result['lidar_bboxes'].

Could you show me the complete code here ? Thanks.

@ye12121
Copy link

ye12121 commented Nov 16, 2022

Hello @azooz95,

Did you modify the original code? I find line 592 in file "PointPillars/utils/process.py" is not lidar_bboxes = result['lidar_bboxes'].

Could you show me the complete code here ? Thanks.

我也遇到这个问题,报错也是在这行代码 lidar_bboxes = result['lidar_bboxes'],原因是result不是dict,返回的是一个空的tuple。应该是模型推理过程中没有检测到物体。对应的代码应该是 pointpillars.py中337行 return [], [], []。评估函数里没有对异常值做处理所以报错了。

@quliang93
Copy link

quliang93 commented May 7, 2023

Hello @azooz95,

Did you modify the original code? I find line 592 in file "PointPillars/utils/process.py" is not lidar_bboxes = result['lidar_bboxes'].

Could you show me the complete code here ? Thanks.

Thank you for your reply !
Great Job !
This problem didn't happen in official KITTI dataset. But after I tested it in my custom dataset. I also met this error.
I did some test in a special scene. If the scene didn't contain any objects like Car, Pedestrian or Cyclist or the model output ([], [], []). And I got the same error like @azooz95 mentioned.

Can you give me some advice? Thank you very much

@Fudidii
Copy link

Fudidii commented Nov 25, 2024

我也遇到了这个问题,后来发现是改了之后就不能用原来的训练出来的文件,改成自己的文件就好了,特别感谢@ye12121的评论启发

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants