-
Notifications
You must be signed in to change notification settings - Fork 120
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: 'float' object is not subscriptable #4
Comments
Can u please share the steps to reproduce the error? |
Hi Maji: I just issue this cmd below and it gives me this error: root@ubuntu-vm:/opt/edgeai-yolov5# python detect.py --source https://www.youtube.com/watch?v=mMp4UDNII6Q Traceback (most recent call last): BR Rio |
Even I issue this cmd, it gives me the same error: python detect.py --source ./data/images/ --weights yolov5s.pt --conf 0.4 |
If I made this modification, it seems working okay. #Original coords[:, [0, 2]] /= gain[1]coords[:, [1, 3]] /= gain[0]#Rio, might fixed, TBC. is this Working okay log? root@ubuntu-vm:/opt/edgeai-yolov5# python detect.py --source ./data/images/ --weights yolov5s.pt --conf 0.4 Fusing layers... |
Hi Any comments / Feedback? BR Rio |
Hi Rio, Regards, Debapriya |
Debapriya, thanks, thumb up ! |
Traceback (most recent call last):
File "detect.py", line 238, in
main(opt)
File "detect.py", line 233, in main
run(**vars(opt))
File "/root/anaconda3/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "detect.py", line 141, in run
det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round()
File "/opt/edgeai-yolov5/utils/general.py", line 471, in scale_coords
coords[:, [0, 2]] /= gain[1]
TypeError: 'float' object is not subscriptable
May you help to solve this error?
I'm not sure if it can be solved by this way in the ./utils/general.py:
coords[:, [0, 2]] /= gain
coords[:, [1, 3]] /= gain
The text was updated successfully, but these errors were encountered: