import numpy as np
from keras.preprocessing import image
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline
path = './test/paper2.png'
img = image.load_img(path, target_size=(150,150))
imgplot = plt.imshow(img)
x = image.img_to_array(img)
img_test = np.expand_dims(x, axis=0)
classes = model.predict(img_test, batch_size=10)
print(classes)
paper, rock, scissors = classes[0]
if paper==1.:
print('paper')
elif rock==1.:
print('rock')
else:
print('scissors')
output :
AttributeError: module 'keras.preprocessing.image' has no attribute 'load_img'
when I try to run. What does the error mean and how can I fix it? help guys :) I'm trying to learn I don't know anymore which one is wrong
from tensorflow.keras.preprocessing import image
instead as mentioned here @Almaz Fazulzyanov – Reconnaissance