Giter Site home page Giter Site logo

Asking about coral delegates about sig-tfjs HOT 3 OPEN

akunerio avatar akunerio commented on June 27, 2024
Asking about coral delegates

from sig-tfjs.

Comments (3)

pyu10055 avatar pyu10055 commented on June 27, 2024

coral could work for qna models, but the model needs to be converted for coral device.

from sig-tfjs.

mattsoulanille avatar mattsoulanille commented on June 27, 2024

In general, you can convert a model using the Edge TPU Compiler. You can try it out on Google Colab without installing it.

In this case though, the mobilebert qna model that @tensorflow-models/qna uses does not have any Coral-supported ops.

Edge TPU Compiler version 16.0.384591198
Started a compilation timeout timer of 180 seconds.

Model compiled successfully in 520 ms.

Input model: mobilebert_1_default_1.tflite
Input size: 95.80MiB
Output model: mobilebert_1_default_1_edgetpu.tflite
Output size: 95.70MiB
On-chip memory used for caching model parameters: 0.00B
On-chip memory remaining for caching model parameters: 0.00B
Off-chip memory used for streaming uncached model parameters: 0.00B
Number of Edge TPU subgraphs: 0
Total number of operations: 2542
Operation log: mobilebert_1_default_1_edgetpu.log

Model successfully compiled but not all operations are supported by the Edge TPU. A percentage of the model will instead run on the CPU, which is slower. If possible, consider updating your model to use only operations supported by the Edge TPU. For details, visit g.co/coral/model-reqs.
Number of operations that will run on Edge TPU: 0
Number of operations that will run on CPU: 2542
See the operation log file for individual operation details.
Compilation child process completed within timeout period.
Compilation succeeded! 

Note these lines:

Number of operations that will run on Edge TPU: 0
Number of operations that will run on CPU: 2542

This model will need to be quantized to Uint8 and possibly re-trained in order to work on Coral. Even then, I'm not sure all of the ops will be supported. Coral seems to support mostly image-related models, and some audio models, but you can definitely try it and see. Here are some more details on the model requirements for Coral.

Edit: I accidentally hit close on this issue instead of posting this.

from sig-tfjs.

akunerio avatar akunerio commented on June 27, 2024

Thank you for your explanation. Now, I understand.

However, the BERT model cannot be quantized to Uint8 and the model cannot be used with Edge TPU.
https://github.com/sayakpaul/BERT-for-Mobile/blob/master/DistilBERT_SST-2_TPU.ipynb

from sig-tfjs.

Related Issues (12)

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.