Code Monkey home page Code Monkey logo

Comments (4)

lanpa avatar lanpa commented on April 27, 2024

Hi, would you provide a usecase about this feature? Why you need to stop training and then resume? Thanks

from tensorboardx.

jyzhang-bjtu avatar jyzhang-bjtu commented on April 27, 2024

I use tensorflow and pytorch both. In tensorflow, I can use tf.train.Supervisor to manange running models. The tf.train.supervisor can periodically save the running state (or check point) and summary on the disk. It can also restore the running state and the summary for the logging dir.
Use-case 1:Therefore, for some complicated models, I often divided the training process into multiple number of epochs. At end of each batch of epochs, I will check the training results to see whether the trained model is good. If it is Ok, I will terminate the training. If not, I will restart the training.
Use-case 2:For some case, electric power-off will terminate my training process. Thus, when I write a computer software, I often add the save_state and load_state in my program.
Because pytorch is simple and lack of framework like tf.train.supervisor, I need to write it by hand.

I hope these two use cases will help you.

Best

from tensorboardx.

lanpa avatar lanpa commented on April 27, 2024

I found that tensorboard concats data by default, if the event files are in the same directory.

with SummaryWriter('runs/Dec01_19-58-48_Z97X') as w:
    for i in range(100):
        w.add_scalar('test', np.random.randn(), i)

import time
time.sleep(1)

with SummaryWriter('runs/Dec01_19-58-48_Z97X') as w:
    for i in range(100):
        w.add_scalar('test', np.random.randn()+3, i+100)

As long as programmer knows the dir name (and global_iteration), the second usecase can be fulfilled.

For case 1, do you mean something like rollback the history? (discard the bad training result) If I am correct, I guess that delete the event file manually do the trick.

from tensorboardx.

jyzhang-bjtu avatar jyzhang-bjtu commented on April 27, 2024

Got it. Today, I read the source code of tensorboard again. I found the same thing as you found.
Thanks a lot.
For case 1, I just want to pick some better results during the training. Maybe move the event file to another dir is ok.

from tensorboardx.

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.