You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your python version is 3.7 or less this requirement.txt installation will work great,
Those who have python version 3.8+ will face some issues while installing Keras 1.15
For Python version 3.8+ first, install TensorFlow by
pip install tensorFlow
it will install TensorFlow version 2.5
Do these following steps in order to make the project working :
Replace this line graph = tf.get_default_graph() by graph= tf.compat.v1.get_default_graph() in deeplearning.py
Remove this import,
from keras.models import load_model
by this.
from tensorflow import keras
Model is loaded in deeplearning.py instead load it inside the working code
with graph.as_default():
model = tf.keras.models.load_model('AlexNetModel.hdf5')
prediction = model.predict(image_array)
4: The code is using Keras library for importing images you can now import it by Image library.
comment this line# img = image.load_img('sample_image.png', target_size=(224, 224))
comment this line# img = image.img_to_array(img)
comment this line# img = np.expand_dims(img, axis=0)
comment this line# img = img/255
comment this line# print(type(img))
comment this line# img = tf.keras.preprocessing.image.array_to_img(img_data)
@garudaonekh If you have done all the steps from 1 to 3 correctly. Then for step 4 go to view.py inside plant_app folder and replace those lines above with the new ones.
If your python version is 3.7 or less this requirement.txt installation will work great,
Those who have python version 3.8+ will face some issues while installing Keras 1.15
For Python version 3.8+ first, install TensorFlow by
it will install TensorFlow version 2.5
Do these following steps in order to make the project working :
by this.
4: The code is using Keras library for importing images you can now import it by Image library.
comment this line# img = image.load_img('sample_image.png', target_size=(224, 224))
comment this line# img = image.img_to_array(img)
comment this line# img = np.expand_dims(img, axis=0)
comment this line# img = img/255
comment this line# print(type(img))
comment this line# img = tf.keras.preprocessing.image.array_to_img(img_data)
Now replace those lines by these lines :
These steps will fix your code according to the version.
The text was updated successfully, but these errors were encountered: