Closed karthimk21 closed 4 years ago
Yes I got the same error as well.
download the data-set and set data-set path like given below Ex: path =r 'C:/downloads/mjsynth.tar/mnt/ramdisk/max/90kDICT32px'
pass imge numpy array to this method before passing to prediction
def reshapeImage(img): img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) img = np.expand_dims(img , axis = 2) dim = (128, 32) img = cv2.resize(img, dim, interpolation = cv2.INTER_AREA) img = np.expand_dims(img , axis = 2) img = img/255. return img
Add the below line before mode.predict
valid_img = valid_img[np.newaxis, ...]
prediction = act_model.predict(valid_img)
Getting this same error while training the model. I have also checked my path for images. it is also correct. What can be the issue?
I'm following your steps but getting the same error again and again Error when checking input: expected input_1 to have 4 dimensions, but got array with shape (0, 1)