I am trying to take a single input image and predict its label. Training data image was converted to array and labels to int and made into a single dataset using DatasetMixin before feeding into classifier. So I have converted the image into array.
When I tried with the given code..this is the error... Expect: in_types[0].shape[1] == in_types[1].shape[1] * 1 Actual: 240 != 3
img = cv2.imread('C:/Users/Dell/Desktop/TEST IMAGES/MONOCYTE.jpeg')
plt.imshow(img)
plt.show()
img=np.array((img), dtype = np.float32)
img=img/255.0
x = Variable(np.asarray([img]))
y = model(x)
prediction = y.data.argmax(axis=1)