Loaded Model Provides only Binary Outputs

I trained a binary classification model that was providing predicted outputs within the range 0 - 1 (Sigmoid activation function outputting predictions). This was working as desired as below:

[[0.8134029 ]
 [0.20651695]
 ...
 [0.18252395]
 [0.87311405]]

However, after saving the model and trying to re-load and use it on the same data the output has changed to:

[[1.]
 [0.]
 ...
 [0.]
 [1.]]

Is there a way to return the output as described at the beginning when re-loading a saved model?

@Jack_Zimmerman,

Welcome to the Tensorflow Forum!

I tried to save the model using model.save and reloaded using tf.keras.models.load_model and it is working as expected. How are you saving and reloading the model?

Could you please share the standalone code to reproduce the above issue?

Thank you!

Answer was that i was just forgetting to normalise the input data based on my training data, just wanted to make sure I was making a mistake. Thanks for the help!

1 Like