Answers for "load saved model"

1

load saved model

# compile the model in order to make predictions
model.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
Posted by: Guest on October-01-2021
1

load saved model

from keras.models import load_model
model = load_model('my_model.h5')
Posted by: Guest on October-01-2021
1

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)
Posted by: Guest on October-01-2021

Code answers related to "load saved model"

Python Answers by Framework

Browse Popular Code Answers by Language