DALI icon indicating copy to clipboard operation
DALI copied to clipboard

TF Keras Multiple inputs/outputs

Open LucasSloan opened this issue 4 years ago • 7 comments

tf.keras allows you to define models with multiple inputs and outputs, but in order to use the standard keras training loops, you need to provide a tf.Dataset which returns either 2 tuples or 2 dictionaries.

I can see how to create a tf.Dataset with DALI that returns more than 2 tensors, but I don't see how to return tuples or dictionaries. Is there a way to do that?

LucasSloan avatar Feb 21 '21 07:02 LucasSloan

@awolant ?

JanuszL avatar Feb 22 '21 11:02 JanuszL

Thanks for the question. Right now something like this is not supported in DALI out of the box, unfortunately. We have outputs mapping for TF dataset on our radar.

Are you interested in scenario similar to the one in the TensorFlow docs you linked? If you need something different, it would be very helpful, if you could share some small toy example, that we could test against.

Also, do you need this in multi-gpu setup?

awolant avatar Feb 23 '21 17:02 awolant

The linked example covers my needs. Thanks!

LucasSloan avatar Feb 23 '21 17:02 LucasSloan

The linked example covers my needs. Thanks!

Has the linked example been removed?

Also, this issue was added to user requests and was marked as done two months later, but I can not find any reference to an implementation. Was it cancelled? I can not return a dictionary or tuple from my pipeline in v1.10.0

gemenerik avatar Mar 10 '22 15:03 gemenerik

Hi @gemenerik,

I think that this issue may have been closed by mistake. I thought that The linked example covers my needs. Thanks! means that the issue is resolved, while the sentence refers to the link describing the use case.

I'm sorry but it still has not been implemented.

JanuszL avatar Mar 11 '22 16:03 JanuszL

Hi! Any updates on that issue? I also have a Keras use case which requires multi-input support...

nivosco avatar Apr 10 '22 06:04 nivosco

@nivosco,

Sorry to say, but still no.

JanuszL avatar Apr 11 '22 10:04 JanuszL