Issue with TensorFlow Lite Model Maker: Empty Output on iOS with TensorFlowLiteTaskAudio 0.4.3
@ghashi Does the issue replicate in TF v2.13 as well?  Please let us know. 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. I tried to use tensorflow 2.13, but it was not possible.

After installing tensorflow 2.13 (it needs python3.8), I installed  tflite-model-maker using: `pip install tflite-model-maker`
The installation finished but  tflite-model-maker downggrades tensorflow to 2.9. 

Obs: I am almost sure it is a problem on the pod TensorFlowLiteTaskAudio because it works on Android and it also works on iOS if you use TensorFlowLite (instead of TensorFlowLiteTaskAudio) 
To use TensorFlowLite you can follow this example: https://github.com/tensorflow/examples/tree/master/lite/examples/sound_classification/ios
 @ghashi Thank you for the update!
@pjpratik Could you please have a look at this?
Thank you! Hi @ghashi, I am having trouble reproducing your issue. I cloned the github repo and opened the "iOS" folder in xcode, then tried to run it on an emulator. It is saying "unable to open configuration settings file" I'm not sure if this project was exported properly or perhaps I missed a step. Do you have any idea what may be the issue there? Alternatively, if there is a way to reduce your code to just reproduce the offending part? (Such as just loading the model and running it on a sample audio file in the App's init function), a toy project.
<img width="1246" alt="image" src="https://github.com/tensorflow/tensorflow/assets/132095473/8ef5e716-c6c4-4e9d-90d3-54cfc7b1010f">
 Hi @pkgoogle , thanks for your quick response!

My code is almost identical to this one https://github.com/tensorflow/examples/tree/master/lite/examples/sound_classification/ios
The difference is that it also runs a model created using "TensorFlow Lite Model Maker"

> Do you have any idea what may be the issue there? A

From your error message, it seems that you need to run `pod install`

--

Please try [these instructions ](https://github.com/tensorflow/examples/tree/master/lite/examples/sound_classification/ios#build-and-run): 

1.  Install the pod to generate the workspace file: `cd tensor-flow-lite-task-audio-poc/ios && pod install`
  Note: If you have installed this pod before and that command doesn't work, try `pod update`.
  At the end of this step you should have a directory called `AudioClassification.xcworkspace`.
2.  Open the project in Xcode with the following command: `open AudioClassification.xcworkspace`

This launches Xcode and opens the `AudioClassification` project.

1.  Select the `SoundClassification` project in the left hand navigation to open the project configuration. In the **Signing** section of the **General** tab, select your development team from the dropdown.
2.  In order to build the project, you must modify the **Bundle Identifier** in the **Identity** section so that it is unique across all Xcode projects. To create a unique identifier, try adding your initials and a number to the end of the string.
3. Build and run the app in Xcode.

 Hi @ghashi, I was able to use your code and run it on emulator, thanks for your help.

How are you expecting results.classifications[1] to be used? The code seems to be expecting to just use results.classifications[0], which it seems to be able to be use. I guess I'm unsure what you are expecting there as it seems the program doesn't use it. > How are you expecting results.classifications[1] to be used?

I want to print them on the screen, but they are always empty on iOS (on Android it works)

> The code seems to be expecting to just use results.classifications[0], which it seems to be able to be use

In fact it is not exactly right. It is supposed to return 521 results, but it only returns 5 results on iOS (on Android it works)

--

There are some screenshots here showing this behavior: https://github.com/tensorflow/tflite-support/issues/933#issue-1825138115   Hi @ghashi, I understand that the results are different but do we know where these 521 results are used or how they are supposed to be used? if used at all? If it's never used, perhaps it was never intended to be consistent. Do you have a use case that requires these results? I understand your point. Let me try to clarify it.

as described here https://www.tensorflow.org/lite/models/modify/model_maker/audio_classification#testing_the_model_optional

> The model you've just trained has 2 outputs: The original YAMNet's output and the one you've just trained. This is important because the real world environment is more complicated than just bird sounds. You can use the YAMNet's output to filter out non relevant audio, for example, on the birds use case, if YAMNet is not classifying Birds or Animals, this might show that the output from your model might have an irrelevant classification.

In my case, I want to use the 521 results (= `results.classifications[0]` ; = YAMNet's raw output) to do exactly what's described in the text: "You can use the YAMNet's output to filter out non relevant audio..."

But more important than that, I need `results.classifications[1]` because that's the classification of my custom model built using [TensorFlow Lite Model Maker](https://www.tensorflow.org/lite/models/modify/model_maker) and right now it is always empty. 

Do you know why `results.classifications[1]`  is always empty? Hi @ghashi, thanks for the additional input. We just wanted to be able to prioritize things effectively, Thanks for your help!

Hi, @yishuangP, can you please take a look?
### 1. System information

#### model generation
- OS Platform and Distribution: macOS 12.6.5 (21G531)
- Python 3.7
- Numpy Version: 1.21.6
- TensorFlow Version: 2.9.3
- Model Maker Version: 0.4.2 (and 0.3.4)
- portaudio: stable 19.7.0

#### model execution
- pod TensorFlowLiteTaskAudio: 0.4.3
- iPhone 8 - iOS 16.5.1

### 2. What's happening

I am encountering an issue while working with TensorFlowLite TaskAudio. Despite my attempts to seek assistance through various channels, I haven't received a response yet. I am reaching out to you here as well.

#### Summary:
I have created a model using TensorFlow Lite Model Maker, and it performs as expected on Android. However, when running the same model on iOS using TensorFlowLiteTaskAudio version 0.4.3 (and nightly), the output is consistently empty. This issue prevents the accurate classification of audio data, as the expected output is missing.

#### Steps to Reproduce:

1. Clone the sample repository: [GitHub Repository](https://github.com/ghashi/tensor-flow-lite-task-audio-poc)
2. Run the iOS application and provide input audio data for classification using the model created with "TensorFlow Lite Model Maker".
3. Observe that the output results.classifications[1].categories are empty, unlike the expected output.
![image](https://github.com/tensorflow/tensorflow/assets/884725/4d278b52-c811-425d-84ab-4f9da91b6c77)

####  Expected Behavior:
The output of the TensorFlow Lite model should contain meaningful results in the results.classifications[1].categories field, similar to the behavior observed on Android.

#### Additional Information:

I have opened an issue on the tflite-support repository (which has more info regarding this issue)  [GitHub Issue #933](https://github.com/tensorflow/tflite-support/issues/933), but now I see that this repo has more issues related to "TensorFlow Lite Model Maker"
I have also posted a topic on the TensorFlow forum: [Forum Topic](https://discuss.tensorflow.org/t/possble-bug-model-created-with-tensorflow-lite-model-maker-model-always-returns-empty-output-on-ios-with-tensorflowlitetaskaudio-0-4-3/18622)

The problem seems to be specific to the TensorFlowLiteTaskAudio on iOS, as the same model works as expected on Android.

I kindly request your assistance in investigating and resolving this issue. 
Thank you for your time and consideration.