Manish8798/Weapon-Detection-with-yolov3

IndexError: invalid index to scalar variable.

Closed this issue · 2 comments

When I tried to run your code with your weight I'm seeing an error message.|

C:\Users\USER_Name\AppData\Local\Programs\Python\Python310\python.exe C:/Users/USER_Name/Desktop/Weapon-Detection-with-yolov3/weapon_detection/weapon_detection.py

Traceback (most recent call last):
 File "C:\Users\USER_Name\Desktop\Weapon-Detection-with-yolov3\weapon_detection\weapon_detection.py", line 13, in <module>
   output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
 File "C:\Users\Dushyant\Desktop\AI\MKProjects]\Weapon-Detection-with-yolov3\weapon_detection\weapon_detection.py", line 13, in <listcomp>
   output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.

Process finished with exit code 1 

i tried your code and there is a error kindly if you will see my comment reply me and tell me what is this error..

C:\Users\USER_Name\AppData\Local\Programs\Python\Python310\python.exe C:/Users/USER_Name/Desktop/Weapon-Detection-with-yolov3/weapon_detection/weapon_detection.py

Traceback (most recent call last):
File "C:\Users\USER_Name\Desktop\Weapon-Detection-with-yolov3\weapon_detection\weapon_detection.py", line 13, in
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
File "C:\Users\Dushyant\Desktop\AI\MKProjects]\Weapon-Detection-with-yolov3\weapon_detection\weapon_detection.py", line 13, in
output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
IndexError: invalid index to scalar variable.

Process finished with exit code 1

I have fixed the issue now