--------------------------------------------------------------------------- IndexError Traceback (most recent call last) <ipython-input-29-f4b5699acb97> in <module>() 3 img = cv2.cvtColor(img, cv2.COLOR_GRAY2RGB) 4 img = cv2.resize(img, (512, 512)) ----> 5 label = y[i-1] 6 training_data.append([img, label]) 7 IndexError: list index out of range