I'm trying to use my own 28x28 pixel image in my CNN but I keep getting this error when I'm trying to reshape it:
x = x.reshape(1,28,28,1)
ValueError: cannot reshape array of size 2352 into shape (1,28,28,1)
My image is 28x28, but I can't change it into a single greyscale channel. I've been using spyder via anaconda and I keep getting an "UnsatisfiableError" whenever I am trying to install opencv onto my root environment. Pip install doesn't work either. I was wondering if anyone had anyway to reshape my images without using an external library and just using tensorflow.
I have searched SO for the answer and tried solutions suggested but unfortunately none of them have worked.
Thanks in advance.
In reply to AKX:
def Predict(imgPath):
x = plt.imread(imgPath)
x = x.reshape(1,28,28,1)
with graph.as_default():
out = model.predict(x)
return out
In reply to Skander HR:
(28,28,3)
In reply to Matias Valdenegro:
My problem is that openCV isn't working. It's installed but I've tried to check if there were any proxy servers, installed python3.dll and tried installing the microsoft mediafeaturepack to get rid of the error but none of those worked. When I write a program like this:
import cv2 as cv
print("done")
I get the error message:
import cv2 as cv
ImportError: DLL load failed: The specified module could not be found.