Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Crash Unexpected failure when preparing tensor allocations - Android 10 (Mi 9T) #27

Open
onurays opened this issue Aug 23, 2020 · 8 comments

Comments

@onurays
Copy link

onurays commented Aug 23, 2020

Crashing at startup:

2020-08-23 14:01:54.068 3006-3124/unibo.cvlab.pydnet_tflite E/AndroidRuntime: FATAL EXCEPTION: inference
    Process: unibo.cvlab.pydnet_tflite, PID: 3006
    java.lang.IllegalStateException: Internal error: Unexpected failure when preparing tensor allocations: tensorflow/lite/kernels/conv.cc:313 input->dims->size != 4 (1 != 4)
    Node number 0 (CONV_2D) failed to prepare.
    
        at org.tensorflow.lite.NativeInterpreterWrapper.allocateTensors(Native Method)
        at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:149)
        at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:343)
        at org.tensorflow.lite.Interpreter.run(Interpreter.java:304)
        at unibo.cvlab.pydnet.Model.doInference(Model.java:89)
        at unibo.cvlab.pydnet.StreamActivity.doInference(StreamActivity.java:131)
        at unibo.cvlab.pydnet.StreamActivity.access$200(StreamActivity.java:26)
        at unibo.cvlab.pydnet.StreamActivity$2.run(StreamActivity.java:122)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:224)
        at android.os.HandlerThread.run(HandlerThread.java:67)
@onurays
Copy link
Author

onurays commented Aug 23, 2020

First of all, you need add:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

@watchman94
Copy link

The problem still exists.

@FilippoAleotti
Copy link
Owner

Hi,
I guess you are using the previous version of the code in this repo, have you tried to update the tf-interpreter version? Maybe it is too old

@onurays
Copy link
Author

onurays commented Aug 24, 2020

Hi,
I guess you are using the previous version of the code in this repo, have you tried to update the tf-interpreter version? Maybe it is too old

I am using the latest version of the tflite branch. I both tried with several versions of tensorflow-lite including nightly. tf-interpreter is a part of tensorflow-lite, right?

@FilippoAleotti
Copy link
Owner

And about the code? I guess you are you using the android code from the previous version, but are you loading the new or the old checkpoint?

@watchman94
Copy link

watchman94 commented Aug 26, 2020 via email

@FilippoAleotti
Copy link
Owner

I mean, in the tflite branch which model are you trying to load? The pydnet++ (the one included in that branch) or the new one?

@onurays
Copy link
Author

onurays commented Aug 31, 2020

The tflite branch has already its own model. I both used it and tried to generate a new one with the script in the branch. I also tried to use scripts under the master branch and I did all of these tests with different tensorflow versions. Are you planning to update the model and scripts in this branch?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants