Unknown initializer: GlorotUniform when loading Keras model











up vote
0
down vote

favorite












I trained my CNN (VGG) through google colab and generated .h5 file. Now problem is, I can predict my output successfully through google colab but when i download that .h5 trained model file and try to predict output on my laptop, I am getting error when loading the model.



Here is the code:



import tensorflow as tf
from tensorflow import keras
import h5py

# Initialization

loaded_model = keras.models.load_model('./train_personCount_model.h5')


And the error:



ValueError: Unknown initializer: GlorotUniform









share|improve this question




















  • 1




    Probably caused by a Keras version mismatch between google colab's and your local machine's.
    – today
    yesterday












  • okie let me check..!
    – Dhruvin modi
    yesterday






  • 1




    Or it can also be caused by mixing tf.keras and keras (not the same).
    – Matias Valdenegro
    yesterday










  • @today maybe you are right..i'll acknowledge if that works or vice-versa.
    – Dhruvin modi
    yesterday










  • @MatiasValdenegro i have used tf.keras on both platform (i.e. google colab as well as my laptop)
    – Dhruvin modi
    yesterday















up vote
0
down vote

favorite












I trained my CNN (VGG) through google colab and generated .h5 file. Now problem is, I can predict my output successfully through google colab but when i download that .h5 trained model file and try to predict output on my laptop, I am getting error when loading the model.



Here is the code:



import tensorflow as tf
from tensorflow import keras
import h5py

# Initialization

loaded_model = keras.models.load_model('./train_personCount_model.h5')


And the error:



ValueError: Unknown initializer: GlorotUniform









share|improve this question




















  • 1




    Probably caused by a Keras version mismatch between google colab's and your local machine's.
    – today
    yesterday












  • okie let me check..!
    – Dhruvin modi
    yesterday






  • 1




    Or it can also be caused by mixing tf.keras and keras (not the same).
    – Matias Valdenegro
    yesterday










  • @today maybe you are right..i'll acknowledge if that works or vice-versa.
    – Dhruvin modi
    yesterday










  • @MatiasValdenegro i have used tf.keras on both platform (i.e. google colab as well as my laptop)
    – Dhruvin modi
    yesterday













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I trained my CNN (VGG) through google colab and generated .h5 file. Now problem is, I can predict my output successfully through google colab but when i download that .h5 trained model file and try to predict output on my laptop, I am getting error when loading the model.



Here is the code:



import tensorflow as tf
from tensorflow import keras
import h5py

# Initialization

loaded_model = keras.models.load_model('./train_personCount_model.h5')


And the error:



ValueError: Unknown initializer: GlorotUniform









share|improve this question















I trained my CNN (VGG) through google colab and generated .h5 file. Now problem is, I can predict my output successfully through google colab but when i download that .h5 trained model file and try to predict output on my laptop, I am getting error when loading the model.



Here is the code:



import tensorflow as tf
from tensorflow import keras
import h5py

# Initialization

loaded_model = keras.models.load_model('./train_personCount_model.h5')


And the error:



ValueError: Unknown initializer: GlorotUniform






python tensorflow machine-learning keras google-colaboratory






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday









desertnaut

15k53060




15k53060










asked yesterday









Dhruvin modi

13




13








  • 1




    Probably caused by a Keras version mismatch between google colab's and your local machine's.
    – today
    yesterday












  • okie let me check..!
    – Dhruvin modi
    yesterday






  • 1




    Or it can also be caused by mixing tf.keras and keras (not the same).
    – Matias Valdenegro
    yesterday










  • @today maybe you are right..i'll acknowledge if that works or vice-versa.
    – Dhruvin modi
    yesterday










  • @MatiasValdenegro i have used tf.keras on both platform (i.e. google colab as well as my laptop)
    – Dhruvin modi
    yesterday














  • 1




    Probably caused by a Keras version mismatch between google colab's and your local machine's.
    – today
    yesterday












  • okie let me check..!
    – Dhruvin modi
    yesterday






  • 1




    Or it can also be caused by mixing tf.keras and keras (not the same).
    – Matias Valdenegro
    yesterday










  • @today maybe you are right..i'll acknowledge if that works or vice-versa.
    – Dhruvin modi
    yesterday










  • @MatiasValdenegro i have used tf.keras on both platform (i.e. google colab as well as my laptop)
    – Dhruvin modi
    yesterday








1




1




Probably caused by a Keras version mismatch between google colab's and your local machine's.
– today
yesterday






Probably caused by a Keras version mismatch between google colab's and your local machine's.
– today
yesterday














okie let me check..!
– Dhruvin modi
yesterday




okie let me check..!
– Dhruvin modi
yesterday




1




1




Or it can also be caused by mixing tf.keras and keras (not the same).
– Matias Valdenegro
yesterday




Or it can also be caused by mixing tf.keras and keras (not the same).
– Matias Valdenegro
yesterday












@today maybe you are right..i'll acknowledge if that works or vice-versa.
– Dhruvin modi
yesterday




@today maybe you are right..i'll acknowledge if that works or vice-versa.
– Dhruvin modi
yesterday












@MatiasValdenegro i have used tf.keras on both platform (i.e. google colab as well as my laptop)
– Dhruvin modi
yesterday




@MatiasValdenegro i have used tf.keras on both platform (i.e. google colab as well as my laptop)
– Dhruvin modi
yesterday

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53183865%2funknown-initializer-glorotuniform-when-loading-keras-model%23new-answer', 'question_page');
}
);

Post as a guest





































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53183865%2funknown-initializer-glorotuniform-when-loading-keras-model%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

横浜市

Rostock

Europa