AttributeError: 'Sequential' object has no attribute 'predict_classes'. Did you mean: 'predict_step'?

33 views Asked by At

I facing the above error where I testing the model of traffic sign detection. I am just Beginner to learning the model train. I watch the test in YouTube you are going well but the video was 4 year old may be that why I facing this error I have not idea what to do if any one can please answer me. thank you

       # PROCESS IMAGE
img = np.asarray(imgOrignal)
img = cv2.resize(img, (32, 32))
img = preprocessing(img)
cv2.imshow("Processed Image", img)
img = img.reshape(1, 32, 32, 1)
cv2.putText(imgOrignal, "CLASS: " , (20, 35), font, 0.75, (0, 0, 255), 2, cv2.LINE_AA)
cv2.putText(imgOrignal, "PROBABILITY: ", (20, 75), font, 0.75, (0, 0, 255), 2, cv2.LINE_AA)
# PREDICT IMAGE
predictions = model.predict(img)
classIndex = model.predict_classes(img)
probabilityValue =np.amax(predictions)
cv2.putText(imgOrignal,str(classIndex)+" "+str(getCalssName(classIndex)), (120, 35), font, 0.75, (0, 0, 255), 2, cv2.LINE_AA)
cv2.putText(imgOrignal, str(round(probabilityValue*100,2) )+"%", (180, 75), font, 0.75, (0, 0, 255), 2, cv2.LINE_AA)
cv2.imshow("Result", imgOrignal)

k=cv2.waitKey(1) 
if k== ord('q'):
    break

cv2.destroyAllWindows()
cap.release()
0

There are 0 answers