# Keras model has a good validation accuracy but makes bad predictions

I have this model which takes 9000 images in a dataset containing 96 categories of traffic signs, each category has more or less the same number of images (about 50). This is the model I made but somehow the predictions are really bad even if the validation accuracy is really high (99%). I can't figure it out what's wrong. I read some possibilities are: overfitting, cnn is too big for the dataset I use, I train on the same data I use to validate the model. How can I understand where I am failing at?

JSON_PATH = "/Users/user/Documents/ML Projects/classname.json"
DATASET_PATH = "/Users/user/Documents/ML Projects/Dataset"

CLASSNAME_SIZE = 96
IMG_SIZE = 48

with open(JSON_PATH) as classnameJSON:

trainingData = []
X = []
Y = []
X_val = []
Y_val = []

for instance in range(CLASSNAME_SIZE):
joinedPath = os.path.join(DATASET_PATH, str(instance))
label = str(instance)
for img in os.listdir(joinedPath):
try:
new_array = cv2.resize(img_array, (IMG_SIZE, IMG_SIZE))
trainingData.append([new_array, label])
except Exception as err:
pass

print(len(trainingData))

def distributeTrainingData():
for img, label in trainingData:
X.append(img)
X_val.append(img)
Y.append(label)
Y_val.append(label)

distributeTrainingData()
print("distributing data")

X = np.array(X, dtype='float32')
Y = np.array(Y, dtype='float32')
X_val = np.array(X_val, dtype='float32')
Y_val = np.array(Y_val, dtype='float32')
print(len(X))
print(len(Y))

def cnn_model():
model = Sequential()
activation='relu'))

return model

#model = cnn_model()

model.compile(loss='sparse_categorical_crossentropy',
model.save('traffic_signs.model')
`