Skip to content
Advertisement

Keras image generator keep giving different number of labels

I am trying to make a simple fine turned Resnet50 model using the Market1501 dataset and keras.

So the data set contains images (12000 or so) and 751 labels that I want to use (0-750). I can fit the data into a single go so I have to use a image generator for this.

So my base model is like this

JavaScript

And my image generator is like this

JavaScript

And I use it like this

JavaScript

The issue is it give me this error

Error when checking target: expected fc8 to have shape (751,) but got array with shape (742,)

And the bigger issue is the 2nd number keep changing so I know its something with the image generator not getting every label in for each iteration.

EDIT
How the data is generated:
There is a external list with the image and the label like this

JavaScript

This is read in and loaded into a array. The label is the number after the image

Advertisement

Answer

change

JavaScript

with

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement