I'm going to make a scissors paper rock games using tensorflow, so i wanna input an image and the output like 'paper', 'scissors', or 'rock' depend on the image, but i have a problem to do it => The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() , so How to fix it?, so pls n help me
this is mycode
import numpy as np
from google.colab import files
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
uploaded = files.upload()
for fn in uploaded.keys():
# predicting images
path = fn
img = image.load_img(path, target_size=(150,150))
imgplot = plt.imshow(img)
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
images = np.vstack([x])
classes = model.predict(images, batch_size=10)
print(fn)
if classes==0:
print('paper')
elif classes==1:
print('scissors')
else:
print('rock')
in the end the error like this
ValueError Traceback (most recent call last)
<ipython-input-69-ca5bd193fb08> in <module>()
23
24 print(fn)
---> 25 if classes==0:
26 print('paper')
27 elif classes==1:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
guide me in my beginner guys plss Thx