Giter VIP home page Giter VIP logo

Comments (4)

bkellenb avatar bkellenb commented on May 12, 2024 1

The way I do this for PyTorch models is to just return a Python dict with model parameters inside. What you could do is to instead return a byte array of the HDF5 file at the end of the train function (perhaps like described here).
I know this is just as clunky, but at least it would keep the model parameters completely in the database and not just the reference.

I have plans to provide more flexibility for file storage in the future anyway. An option is to explicitly expose the project's data path to the model, so that it can indeed store the model file under a logical path and just return the directory to the database.

from aerial_wildlife_detection.

bkellenb avatar bkellenb commented on May 12, 2024

Hi,

Good question; I remember saving and loading model states to be a bit of a hassle in TensorFlow.
I found the functions model.get_weights() and model.set_weights(), although they are primarily provided for the Keras wrapper: https://www.tensorflow.org/guide/keras/save_and_serialize#weights-only_saving
For TensorFlow itself the functions tf.all_variables() or tf.trainable_variables() might work instead: google/prettytensor#6 (comment)

from aerial_wildlife_detection.

ctorney avatar ctorney commented on May 12, 2024

Thanks for the info - I guess I was thinking more of how to store in the AIde db. The keras wrapper saves weights and architecture in hdf5 format but I couldn't find a way to save this file format into the database. Storing the filepath in the database and the hdf5 file to disk works but seems a bit clunky

from aerial_wildlife_detection.

ctorney avatar ctorney commented on May 12, 2024

Thanks - I'll have a look at the byte array approach - I agree keeping all parameters in the database would be a much nicer solution

from aerial_wildlife_detection.

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.