TypeError: slice indices must be integers or None or have an __index__ method
Closed this issue · 6 comments
bryanbocao commented
Traceback (most recent call last):
File "sample_coco.py", line 156, in <module>
main()
File "sample_coco.py", line 62, in main
for i in keys[:parser.sample_image_count]:
TypeError: slice indices must be integers or None or have an __index__ method
when running sample_coco.py
script.
bryanbocao commented
Just made a pull request. It simply casts input type from str to int.
wyw1993121 commented
I solved this problem by change
for i in keys[:parser.sample_image_count]:
to
for i in keys[:int(parser.sample_image_count)]:
bryanbocao commented
It simply casts input type from str to int.
Yes, as mentioned.
TANKCHENG commented
this debug could be pushed to project, thanks for your bug mentioned.
giddyyupp commented
Fix merged.
TANKCHENG commented
自动回复: 已收到,谢谢来信