Output tensor at index 0 is expected to have 3 dimensions, found 2

I am working on creating an Android app. I am getting this error “Error occurred when initializing ObjectDetector: Output tensor at index 0 is expected to have 3 dimensions, found 2.” I have tried to search for the error and followed downgrading tensorflow but doesn’t solve the problem. I am attaching the quantized model if anyone can help.

Quantized Model

@P_MRT,

Welcome to the Tensorflow Forum!

Could you please upgrade to the latest version of the Android app example for TensorFlow and let us know?

Thank you!

Thanks for your response. I am currently using this one:
Link
Is there any other latest?

@P_MRT,

I have tested the example and app runs as intended. Are you customising the app for custom usage and hitting the problem?

Thank you!

Yes, I am doing custom training and I have attached my model with the question.

@P_MRT,

Unfortunately I don’t have access to your model.

Thank you!

Model Link

Can you check now? I would appreciate if you can help me, been stuck with this prob for a week.

@P_MRT,

Can you please let us know the TF version used for TFLite conversion?

There was known issue of change in the order of output tensors which might be the problem in your case.

Please try with TF 2.12 and TF Nightly and let us know if the issue is still persists. If yes, please try the workaround suggested here

Thank you!

1 Like

hi. I did it, but still don’t work :frowning: