I have a multi input model with a single target variable
After a lot of trial and error (and countless hours on SO) I’ve come this far
#reads in filepaths to images from dataframe train
images = tf.data.Dataset.from_tensor_slices(train.image.to_numpy())
#converts labels to one hot encoding vector
target = tf.keras.utils.to_categorical(
train.Label.to_numpy(), num_classes=n_class, dtype=’float32′
#reads in the image and resizes it
#zips the former according to
input_1 = tf.data.Dataset.zip((anchors, target))
dataset = tf.data.Dataset.zip((input_1, target))
and I think this is almost the solution, but the second input shape get’s distorted.
Because I get a warning that input expected is (None, n_class)
But it received an input of (n_class, 1)
And an error:
ValueError: Shapes (n_class, 1) and (n_class, n_class) are incompatible
I checked though, the shapes from to_categorical is correct, it’s num_examples, n_class
Could someone help an utterly confused me out?
Thanks a lot!