Giter VIP home page Giter VIP logo

Comments (4)

sajed-zarrinpour avatar sajed-zarrinpour commented on July 22, 2024

I think this article will help you out.
https://www.tensorflow.org/tutorials/keras/save_and_load

from pinns.

Hochinghao avatar Hochinghao commented on July 22, 2024

but it seens work for keras model but it is tensorflow model .

from pinns.

sajed-zarrinpour avatar sajed-zarrinpour commented on July 22, 2024

I believe you can use the principle here. you can use a costume callback for the purpose as well. try tracing these variables: self.weights
self.biases
I think it will help.

from pinns.

Mohamadrezash204 avatar Mohamadrezash204 commented on July 22, 2024

is there anyway to save the trained model?

you can add this to model:

def save_model(self):
    saver = tf.train.Saver()
    save_path = "meltpool_model.ckpt"
    saver.save(self.sess, save_path)
    print(f"Model saved at {save_path}")

def load_model(self):
    saver = tf.train.Saver()
    save_path = "meltpool_model.ckpt"
    saver.restore(self.sess, save_path)
    print(f"Model loaded from {save_path}")    

To save the model you should call save_model after training. and when you want to use the saved model before the train call the load_model.

from pinns.

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.