Getting an error for IndexError: invalid index to scalar variable on the yolo_layers line.
network = cv2.dnn.readNetFromDarknet('yolov3.cfg', 'yolov3.weights')
layers = network.getLayerNames()
yolo_layers = [layers[i[0] - 1] for i in network.getUnconnectedOutLayers()]
This code won't work on my Jupyter notebook but will run fine on google collab. No idea why. Could be my python version?