Custom loss function with multiple arguments from generator
p.s. these 4 parameters have different type and size, so it is not possible to concatenate them as a single parameter @harborsarah 
Could you please provide reproducible code or Colab gist to replicate the issue reported here ?   Also Could you please try something as mentioned below. 

This is the alternative workaround which might help to resolve the issue. 
https://stackoverflow.com/questions/76059542/found-unexpected-losses-or-metrics-that-do-not-correspond-to-any-model-output

```
def preprocess(data):
  labels = list(dict(filter(lambda x: x[0] != 'vectorizer_input', data.items())).values())
  return data['vectorizer_input'], labels

tfdataset = tfdataset.map(preprocess)
vectorizer = tf.keras.layers.TextVectorization(max_tokens=4000, output_sequence_length=4)
vectorizer.adapt(tfdataset.map(lambda x, y: x))
model = tf.keras.Sequential(
    [
        vectorizer,
        tf.keras.layers.Embedding(4000, 64),
        tf.keras.layers.GlobalMaxPool1D(),
        tf.keras.layers.Dense(97, activation='sigmoid')
    ]
)
```

Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60324">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60324">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

tf 2.8

### Custom Code

Yes

### OS Platform and Distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

I would like to know if it is possible to create a loss function not only get y_true and y_pred as parameters. 
So basically, I want to return 4 parameters in the custom generator but these 4 parameters are all used to calculate one single loss function. I haven't found any example or document about this issue.

### Standalone code to reproduce the issue

```shell
ValueError: Found unexpected losses or metrics that do not correspond to any Model output: dict_keys(['custom_metric']). Valid mode output names: ['association']. Received struct is: {'custom_metric': ((<tf.Tensor 'IteratorGetNext:2' shape=(None, None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:3' shape=(None, None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:4' shape=(None, None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:5' shape=(None, None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:6' shape=(None, None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:7' shape=(None, None, None, None) dtype=float32>), (<tf.Tensor 'IteratorGetNext:8' shape=(None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:9' shape=(None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:10' shape=(None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:11' shape=(None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:12' shape=(None, None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:13' shape=(None, None, None) dtype=float32>), (<tf.Tensor 'IteratorGetNext:14' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:15' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:16' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:17' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:18' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:19' shape=(None, None) dtype=int32>), (<tf.Tensor 'IteratorGetNext:20' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:21' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:22' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:23' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:24' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:25' shape=(None, None) dtype=int32>))}.
```


### Relevant log output

_No response_</details>