Git Product home page Git Product logo

Comments (2)

shubham0204 avatar shubham0204 commented on August 25, 2024

@WuSiangRu You can convert to quantized integer formats, and TensorFlow preserves the float data-type of input and output tensors. Refer these docs. It says,

Now all weights and variable data are quantized, and the model is significantly smaller compared to the original TensorFlow Lite model. However, to maintain compatibility with applications that traditionally use float model input and output tensors, the TensorFlow Lite Converter leaves the model input and output tensors in float

Considering your error, you would have to provide a ByteBuffer where each pixel is encoded as an uint8. In your code, you're providing 307200 sized buffer (probably in float32) whereas the model needs 76800 = 307200 / 4 sized buffer (probably uint8)

from facerecognition_with_facenet_android.

WuSiangRu avatar WuSiangRu commented on August 25, 2024

Hi ,thanks for your reply,sorry for not asking you which version of tensorflow you were using at the beginning. I'm using version 1.15, and the method mentioned in the link you provided seems to require 2.0 or higher.
So I referred to this method and converted the model to keras and then to tfllite in FLOAT32 format and it works.

Also I would like to ask you how to add the ByteBuffer mentioned in the above suggestion to the program code?

from facerecognition_with_facenet_android.

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.