Hello,
I did age and gender classification, but now i want to modify it to try regression for age.
I have images and image name carry info about age of person.
ImageRegressionLabelGenerator labelMaker = new ImageRegressionLabelGenerator();
ImageRecordReader recordReader = new ImageRecordReader(height, width, channels, labelMaker);
recordReader.initialize(trainingData, getImageTransform());
DataSetIterator dataSetIterator = new RecordReaderDataSetIterator(recordReader, batchSize, 1, 1, true);
dataNormalization.fit(dataSetIterator);
dataSetIterator.setPreProcessor(dataNormalization);
computationGraph.fit(dataSetIterator, numEpochs);
But when I start training, error is:
Labels and preOutput must have equal shapes: got shapes [32, 65] vs [32, 1]
Batch size is 32, i have 90k images in range from 0 to 64.
Last layer:
.addLayer(“outputAge”, new OutputLayer.Builder(LossFunctions.LossFunction.MSE)
.nOut(1)
.activation(Activation.IDENTITY)
.build(), “dense”);
For architecture I am using denseNet example.
How to create this, so i can make model which for provided image return age?