To learn more about deep learning and computer vision, I am working on a project to determine lanes on the roads. I use TFLearn as a wrapper around Tensorflow.
Background
The training inputs are images of roads (each image is represented as a 2D array of 50 × 50 pixels in size, with each element having a brightness value from 0.0 to 1.0).
The training outputs have the same shape (50x50 array), but represent the marked area of the strip. In fact, pixels without a road are 0, and road pixels are 1.
This is not a problem of classifying images with a fixed size, but instead a problem of detecting road and off-road pixels from an image.
Problem
I have not been able to successfully configure my inputs / outputs in such a way that TFLearn / Tensorflow accepts, and I'm not sure why. Here is my sample code:
network = input_data(shape=[None, 50, 50, 1])
network = conv_2d(network, 50, 50, activation='relu')
network = fully_connected(network, 50, activation='softmax')
network = regression(network, optimizer='adam', loss='categorical_crossentropy', learning_rate=0.001)
model = tflearn.DNN(network, tensorboard_verbose=1)
model.fit(X, Y, n_epoch=10, shuffle=True, validation_set=(X, Y), show_metric=True, batch_size=1)
The error I get causes an model.fiterror call :
ValueError: Cannot feed value of shape (1, 50, 50) for Tensor u'InputData/X:0', which has shape '(?, 50, 50, 1)'
I tried to reduce the sample I / O arrays to a 1D vector (2500 in length), but this leads to other errors.
I lost a little how to do it all, any help would be greatly appreciated!