load saved model
# compile the model in order to make predictions
model.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
load saved model
# compile the model in order to make predictions
model.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
load saved model
from keras.models import load_model
model = load_model('my_model.h5')
load saved model
#Now you can predict results for a new entry image.
from keras.preprocessing import image
test_image = image.load_img(imagePath, target_size = (64, 64))
test_image = image.img_to_array(test_image)
test_image = np.expand_dims(test_image, axis = 0)
#predict the result
result = model.predict(test_image)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us