Giter VIP home page Giter VIP logo

Comments (11)

lu-wang-g avatar lu-wang-g commented on July 19, 2024

@khanhlvg do you have any idea why the MetalDelegate cannot be found?

from tflite-support.

khanhlvg avatar khanhlvg commented on July 19, 2024

@GeneralJing what was the error that you saw?

from tflite-support.

GeneralJing avatar GeneralJing commented on July 19, 2024

delegates = [MetalDelegate()] this line, ‘MetalDelegate' cannot find. MetalDelegate()is undefined.

from tflite-support.

adumrewal avatar adumrewal commented on July 19, 2024

@GeneralJing as per the tflite documentation:

"From 2.4.0 version and latest nightly releases, by default GPU and Core ML delegates are excluded from the pod to reduce the binary size. You can include them by specifying subspec:
pod 'TensorFlowLiteSwift', '~> 0.0.1-nightly', :subspecs => ['CoreML', 'Metal']"

So you'll have to add 'Metal' to your podfile and only then will it be available.

from tflite-support.

GeneralJing avatar GeneralJing commented on July 19, 2024

Thanks. I will try that later. Whatever result i have, i will leave a message here.

from tflite-support.

GeneralJing avatar GeneralJing commented on July 19, 2024

I tried it and it worked. Thank you. But the time is very long on iphone 6s.
Preprocessing:197ms
Model inference:56ms
Postprocessing:1591ms
Visualization:8ms.
How did you solve the time-consuming problem of tflite in practice?

from tflite-support.

adumrewal avatar adumrewal commented on July 19, 2024

Yeah I found it to be slow too. Didn't think it could be an issue with tflite implementation. I thought it must be related to model's size or something. I moved on from the model and am now looking for other alternatives.

from tflite-support.

GeneralJing avatar GeneralJing commented on July 19, 2024

Ok, thanks for your help.

from tflite-support.

adumrewal avatar adumrewal commented on July 19, 2024

Hey @GeneralJing, just found this note in the tflite sample codes:

// Note: You may find postprocessing very slow if you run the sample app with Debug build.
// You will see significant speed up if you rerun using Release build, or change
// Optimization Level in the project's Build Settings to the same value with Release build.

Also checkout the following:
https://blog.tensorflow.org/2020/07/accelerating-tensorflow-lite-xnnpack-integration.html

from tflite-support.

GeneralJing avatar GeneralJing commented on July 19, 2024

I only tested the relevant time on my mobile phone and did not notice the relevant notes. Thank you for your carefulness and reminder. The added link is very valuable, and I will study it carefully. If I encounter other related problems later, can I communicate with you by email?

from tflite-support.

adumrewal avatar adumrewal commented on July 19, 2024

Haha yeah, same with me. Also, one more thing I noticed was that the post-processing codes were not optimised (atleast for my use-case) and do not utilise the gpu/multi-threading either. So that is also something you can look into if you want improved performance.

Yeah sure, feel free to reach out.

from tflite-support.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.