research icon indicating copy to clipboard operation
research copied to clipboard

TypeError: slice indices must be integers or None or have an __index__ method

Open fenfeibani opened this issue 8 years ago • 1 comments

when i run " ./view_steering_model.py ./outputs/steering_model/steering_angle.json", it prompt me this error message: Traceback (most recent call last): File "./view_steering_model.py", line 120, in draw_path_on(img, speed_ms, -angle_steers/10.0) File "./view_steering_model.py", line 84, in draw_path_on draw_path(img, path_x, path_y, color) File "./view_steering_model.py", line 59, in draw_path draw_pt(img, x, y, color) File "./view_steering_model.py", line 55, in draw_pt img[row-sz:row+sz, col-sz:col+sz] = color TypeError: slice indices must be integers or None or have an index method How to solve this problem?

fenfeibani avatar Oct 01 '17 23:10 fenfeibani

Hello, I just got into that problem. use img[int(row-sz):int(row+sz), int(col-sz):int(col+sz)] = color

it should work

riyadhlewis avatar Mar 16 '18 21:03 riyadhlewis