Tensorflow Lite应用程序

问题描述 投票:0回答:1

如何将自定义模型应用于tensorflowlite?在该说明中,我想将模型粘贴到资产中并删除下载模型gradle,但是当应用该应用程序时,应用程序会简单地崩溃,这是什么问题?

编辑:

我在tensorflow lite中使用自定义训练时遵循说明,但是在将api模型文件更改为我的模型并注释了下载模型后,应用程序崩溃了。我尝试使用Microsoft General Compact和Compact [s1]的自定义ai,并按照说明https://medium.com/datadriveninvestor/how-to-train-your-own-custom-model-with-tensorflow-object-detection-api-and-deploy-it-into-android-aeacab7fa76f两者都不起作用,compact [s1]使应用程序混乱并崩溃,而compact完全崩溃,所以,这是什么问题,自定义ai简单不能在tensorflowlite中使用吗?

此内容以调试模式显示:

    java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Regular TensorFlow ops are not supported by this interpreter. Make sure you apply/link the Flex delegate before inference.
    Node number 328 (FlexNonMaxSuppressionV4) failed to prepare.

        at org.tensorflow.lite.NativeInterpreterWrapper.applyDelegate(Native Method)
        at org.tensorflow.lite.NativeInterpreterWrapper.applyDelegates(NativeInterpreterWrapper.java:324)
        at org.tensorflow.lite.NativeInterpreterWrapper.init(NativeInterpreterWrapper.java:82)
        at org.tensorflow.lite.NativeInterpreterWrapper.<init>(NativeInterpreterWrapper.java:63)
        at org.tensorflow.lite.Interpreter.<init>(Interpreter.java:237)
        at org.tensorflow.lite.examples.detection.tflite.TFLiteObjectDetectionAPIModel.create(TFLiteObjectDetectionAPIModel.java:140)
        at org.tensorflow.lite.examples.detection.DetectorActivity.onPreviewSizeChosen(DetectorActivity.java:112)
        at org.tensorflow.lite.examples.detection.CameraActivity.onPreviewFrame(CameraActivity.java:200)
        at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1222)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6316)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)```

Edited v2:
Yes, it show up in netron.
[![this is the image of the other persons model][1]][1]
[![this one is my model in microsoft compact[s1][2]][2]
the other model of microsoft compact is to big for png so, it was saved as svg don't know how to show it here.


  [1]: https://i.stack.imgur.com/BtkZ1.jpg
  [2]: https://i.stack.imgur.com/ffnOU.png
tensorflow tensorflow-lite
1个回答
0
投票

TensorFlow Lite不支持您的模型使用的运算符。这是supported ops的列表。

您可以看到如何创建model easily convertible to TensorFlow Lite

© www.soinside.com 2019 - 2024. All rights reserved.