I am a beginner in Machine learning and NN. I am currently working on a project involving training a regression model, saving it and then loading it to make further predictions using that model. However I'm having a problem. Each time that I model.predict on images it gives out the same predictions. I am not entirely sure what the problem is, maybe it's in the training stage or i'm just doing something wrong.
I was following this tutorial
Here are some bits from the code: (This part is training the model and saving it)
model = create_cnn(400, 400, 3, regress=True) opt = Adam(lr=1e-3, decay=1e-3 / 200) model.compile(loss="mean_absolute_percentage_error", optimizer=opt) model.fit(X, Y, epochs=70, batch_size=8) model.save("D:/statispic2/final-statispic_model.hdf5")
model = load_model("D:/statispic2/statispic_model.hdf5") # Loading the model prediction = model.predict(images_ready_for_prediction) #images ready for prediction include a numpy array #that is loaded with the images just like I loaded them for the training stage. print(prediction_list)
[[0.05169942] # I gave it 5 images as parameters [0.05169942] [0.05169942] [0.05169942] [0.05169942]]