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
python tensorflow machine-learning keras google-colaboratory
|
show 1 more comment
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
python tensorflow machine-learning keras google-colaboratory
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
|
show 1 more comment
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
python tensorflow machine-learning keras google-colaboratory
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
python tensorflow machine-learning keras google-colaboratory
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
|
show 1 more comment
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
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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