TF.dataset with multiple outputs

Hello All,
I’m trying to get a TF data working to take in a list of pickle names, read the pickles, separate the inputs and outputs, perform some random rotations on the inputs and targets and return them.

The issue is ideally i want the TF data to return

( X , [Y1, Y2 , Y3 ] )

Since the model needs a list of targets.

I think the problem is that the TF data when it gets the batch, tries to concatenate along the batch dimension, but the list can’t be concatenated.

I can get it to yield a batch of

(X , Y1, Y2, Y3 )

But i cant give this to model.fit since it has to be a tuple of only (X, Y)

Any advice would be great!

Many thanks!

Actually sorted this. I just added a .map() function to combine the Y1,Y2,Y3 into a tuple after the .batch()
method