Skip to content Skip to sidebar Skip to footer

Wrong Output Of Prediction Function In Tensorflow

I am going to perform pixel-based classification on an image. Here is the code I used for training the NN net = input_data(shape=[None, 1,4]) net = tflearn.lstm(net, 128, return_s

Solution 1:

The None parameter is used to denote different training examples. In your case, each image has a total of 28*28*4 parameters, due to the custom four channel dataset you are using.

To make this LSTM work, you should try to do the following -

X = np.reshape(X, (-1, 28, 28, 4))
testX = np.reshape(testX, (-1, 28, 28, 4))

net = tflearn.input_data(shape=[None, 28, 28, 4])

Of course, (this is very important), make sure that reshape() puts the four different channels corresponding to a single pixel in the last dimension of the numpy array, and the 28, 28 correspond to pixels in a single image.


In case your images don't have dimension 28*28, adjust those parameters accordingly.

Post a Comment for "Wrong Output Of Prediction Function In Tensorflow"