Code Monkey home page Code Monkey logo

Comments (3)

galeone avatar galeone commented on August 20, 2024

LoadModel accepts a path because the SavedModel serialization serialize and stores the model as a folder.

The support for frozen models (e.g.models all in one, with variables + structures all of them converted to a single optimized .pb) has been deprecated in TensorFlow 2.0 and it is going to be removed soon - that's why I support only loading from disk.

But maybe I misunderstood your question: do you have a SavedModel loaded in []byte? If yes, how did you loaded it?

If instead, as I thought, you have a .pb file read as a []byte this is not supported with tfgo.

It was present, however, you can go back to a specific commit (0663583) and load your frozen model using this version of tfgo (you also need some old TensorFlow C runtime installed, like 1.x)

from tfgo.

jeremyevith avatar jeremyevith commented on August 20, 2024

Loading models from []byte have a few advantages:

  1. Able to ship a single binary with Go's new embed feature
  2. Being able to apply some kind of encryption/decryption of models in memory

Unfortunately, looks like the current solution of going back to older Tensorflow versions aren't really viable.

from tfgo.

galeone avatar galeone commented on August 20, 2024

Unfortunately, the SavedModel serialization format is a folder - maybe some kind of abstraction can be designed, in order to have a byte array and let tfgo interpret this as a path (since tfgo just invokes the standard TensorFlow C API for loading saved models, and this API wants a location on the disk). But honestly, I don't know if this is feasible or how can this become complex to design and implement

from tfgo.

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.