Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic Error in experimental Unity Plugin HelloTFLite.cs Sample Code #63093

Closed
Tom-James-Marsden opened this issue Feb 29, 2024 · 3 comments
Closed
Assignees
Labels
awaiting PR merge awaiting PR merge comp:lite TF Lite related issues TF 2.15 For issues related to 2.15.x type:bug Bug type:docs-bug Document issues

Comments

@Tom-James-Marsden
Copy link

Issue type

Documentation Bug

Have you reproduced the bug with TensorFlow Nightly?

No

Source

binary

TensorFlow version

tf 2.15

Custom code

No

OS platform and distribution

Windows 11

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 behavior?

Currently in HelloTFLite.cs in the experimental Unity Plugin example project there is a logic error at line 59
Here is the function i am looking at

  void Start () {
    Debug.LogFormat("TensorFlow Lite Verion: {0}", Interpreter.GetVersion());

    var options = new Interpreter.Options() {
      threads = 2,
    };
    interpreter = new Interpreter(model.bytes, options);

    int inputCount = interpreter.GetInputTensorCount();
    int outputCount = interpreter.GetOutputTensorCount();
    for (int i = 0; i < inputCount; i++) {
      Debug.LogFormat("Input {0}: {1}", i, interpreter.GetInputTensorInfo(i));
    }
    for (int i = 0; i < inputCount; i++) {
      Debug.LogFormat("Output {0}: {1}", i, interpreter.GetOutputTensorInfo(i));
    }
  }

In the second for loop the bound inputCount should be outputCount as it is looping through the output tensors

Standalone code to reproduce the issue

Load in a model with input and output tensors of different length and you will find that either not all the tensors get logged or there is an error.

Relevant log output

No response

@google-ml-butler google-ml-butler bot added type:bug Bug type:docs-bug Document issues labels Feb 29, 2024
@tilakrayal tilakrayal added the comp:lite TF Lite related issues label Mar 6, 2024
@LakshmiKalaKadali LakshmiKalaKadali added the TF 2.15 For issues related to 2.15.x label Mar 6, 2024
@LakshmiKalaKadali
Copy link
Contributor

Hi @Tom-James-Marsden,

I have gone through the file and raised a PR. Please track the PR #63131.

Thank You

@Tom-James-Marsden
Copy link
Author

Even though this is such a tiny bug in some experimental code from a project that isn't going to be gone further with I'm dead excited I got to point out and help fix a part of this repository. Whoop whoop

Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting PR merge awaiting PR merge comp:lite TF Lite related issues TF 2.15 For issues related to 2.15.x type:bug Bug type:docs-bug Document issues
Projects
None yet
Development

No branches or pull requests

4 participants