I’m trying to create a CNN network to predict a single float number from an image.
The float output can assume the values from 0.0 to 20000.0.
Each image is a coloured 7x7 image, labelled with a float number as well.
This is my DataBlock
x_column = "image" y_column = "label" dls = DataBlock( blocks=(ImageBlock, RegressionBlock), get_x=ColReader(x_column, pref='', suff=''), get_y=ColReader(y_column), batch_tfms= ).dataloaders(df)
df is like that
the CNN is
def conv(ni, nf, ks=3, act=True): res = Conv2d(ni, nf, stride=2, kernel_size=ks, padding=ks//2) if act: res = Sequential(res, ReLU()) return res simple_cnn = Sequential( conv(3, 12, ks=5), conv(12, 24), conv(24, 48), conv(48, 1, act=False), Flatten(), )
and the learner is
learn = Learner(dls, simple_cnn, loss_func=MSELossFlat(), cbs=ActivationStats(with_hist=True))
very simple, but the network isn’t learning, even if use smaller learning rates the result is the same
is the correct model for predicting a number from an image, even if the network never saw the number in the training labels set?