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

Unable to use a different model #3

Closed
ghost opened this issue Nov 12, 2020 · 0 comments
Closed

Unable to use a different model #3

ghost opened this issue Nov 12, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Nov 12, 2020

I'm trying to use a custom model with the following properties:
Screenshot 2020-11-12 at 18 48 33

The original model has these properties instead:
Screenshot 2020-11-12 at 19 09 01

In theory, this should not be a problem as tflite is supposed to accept any TFLite model.

However, this error is thrown

E/AndroidRuntime(29968): Caused by: java.lang.IllegalArgumentException: Cannot copy from a TensorFlowLite tensor (Identity) with shape [1, 3, 6400, 85] to a Java object with shape [1, 80]

when I try to classify an image

Tflite.runModelOnFrame(
      bytesList: image.planes.map((plane) => plane.bytes).toList(),
    )

A similar error

E/AndroidRuntime( 2360): Caused by: java.lang.IllegalArgumentException: Cannot copy from a TensorFlowLite tensor (Identity) with shape [1, 3, 6400, 85] to a Java object with shape [1, 20, 20, 425]

is thrown when trying to detect an object

Tflite.detectObjectOnFrame(
      bytesList: image.planes.map((plane) => plane.bytes).toList(),
      model: "YOLO",
      imageHeight: 640,
      imageWidth: 640,
      imageMean: 0,
      imageStd: 255.0,
      anchors: [
        10,
        13,
        16,
        30,
        33,
        23,
        30,
        61,
        62,
        45,
        59,
        119,
        116,
        90,
        156,
        198,
        373,
        326
      ],
    )

Does anyone has any idea about why this could be happening?

@ghost ghost closed this as completed Jun 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants