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

Failed TensorflowLite Operation #7

Closed
Zumbalamambo opened this issue Feb 20, 2020 · 9 comments
Closed

Failed TensorflowLite Operation #7

Zumbalamambo opened this issue Feb 20, 2020 · 9 comments
Labels
custom model wontfix This will not be worked on

Comments

@Zumbalamambo
Copy link

The input shape of my model is [ 1 256 256 3]

I'm getting the following errror,

Exception: TensorFlowLite operation failed.
TensorFlowLite.Interpreter.ThrowIfError (System.Int32 resultCode)

How do I fix this?

I have invoked the Model as follows,

model.Invoke(background.texture);

background is the rawimage. I tried to save the raw image to png image and ocourse, it is not null.

Following is my Invoke function,

public override void Invoke(Texture inputTex)
        {
            ToTensor(inputTex, inputs);

            Debug.LogWarning(inputTex.height + " " + inputs.Length);
            interpreter.SetInputTensorData(0,  inputs);
            interpreter.Invoke();
        }

How do I fix this error?

@asus4
Copy link
Owner

asus4 commented Feb 21, 2020

I guess its the tensor format mismatching. you can check the input format with the following method. or Netron is a good GUI app.

var info = interpreter.GetInputTensorInfo(index)

or could you share the tflite file? It is difficult to identify this type of program w/o the model.

@Zumbalamambo
Copy link
Author

Zumbalamambo commented Feb 21, 2020

i tried Netron. This is the input part of the graph.

Capture

@asus4
Copy link
Owner

asus4 commented Feb 21, 2020

Click input, then detailed information appears.
MNIST's input is float32, SSD is quantized to uint8.
cap_mnist
cap_ssd

@kasi-str8bat
Copy link

kasi-str8bat commented Jul 16, 2020

Hi, can i turnoff the quantization from the library? is it possible to import float32 model?

@tklecka
Copy link

tklecka commented Aug 21, 2020

@asus4
Same problem here.
The model works well in the Android demo.
The shape is [1,300,300,3].
model.zip

      at TensorFlowLite.Interpreter.ThrowIfError (TensorFlowLite.Interpreter+Status status) [0x00000] in <00000000000000000000000000000000>:0 
      at TensorFlowLite.Interpreter.SetInputTensorData (System.Int32 inputTensorIndex, System.Array inputTensorData) [0x00000] in <00000000000000000000000000000000>:0 
      at TensorFlowLite.SSD.Invoke (UnityEngine.Texture inputTex) [0x00000] in <00000000000000000000000000000000>:0 
       ...

@JoochanKim-LTU
Copy link

JoochanKim-LTU commented Dec 17, 2020

Hi, can i turnoff the quantization from the library? is it possible to import float32 model?

@asus4
Same problem here.
The model works well in the Android demo.
The shape is [1,300,300,3].
model.zip

      at TensorFlowLite.Interpreter.ThrowIfError (TensorFlowLite.Interpreter+Status status) [0x00000] in <00000000000000000000000000000000>:0 
      at TensorFlowLite.Interpreter.SetInputTensorData (System.Int32 inputTensorIndex, System.Array inputTensorData) [0x00000] in <00000000000000000000000000000000>:0 
      at TensorFlowLite.SSD.Invoke (UnityEngine.Texture inputTex) [0x00000] in <00000000000000000000000000000000>:0 
       ...

I'm also trying to solve this issue. Any luck yet?

@stale
Copy link

stale bot commented Apr 8, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 8, 2021
@stale stale bot closed this as completed Apr 15, 2021
@klauspa
Copy link

klauspa commented May 17, 2021

I can't quantized my SSD model, how do I modify the code so that my 32bit model can be loaded in this project? many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
custom model wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

7 participants
@asus4 @tklecka @Zumbalamambo @kasi-str8bat @klauspa @JoochanKim-LTU and others