Home > Software engineering >  How to check the model fitting status via Rest API? Tensorflow, Pytorch, etc
How to check the model fitting status via Rest API? Tensorflow, Pytorch, etc

Time:12-12

I run training of different NN models on the server. I can view models status, metrics via GUI tools like Tensorboard, Weights & Biases. But I need to make the REST API to monitoring the models via my personal frontend page. What's optimal solutions for such tasks? Of course I can write metrics to disk or data base, and read this in another thread, but it's looks a little ugly. I don't understand how to organize exchange between the model's trainer and backend.

CodePudding user response:

You can simply start Tensorboard in broadcast mode. This will allow you to open it on other systems within the network. Don't try to write REST api for this task on your own.

Update:

Based on your comment, you will need to do two things:

  1. Write a REST api with POST method that takes appropriate values you need to save. Invoking this with values, will save them to some database or file system outside tensorflow.

  2. Write a custom callback class in case of tensorflow by inheriting tf.keras.callbacks.Callback to invoke the POST method written in previous step either at training, testing or prediction time. In case of pytorch since it is define by run philosophy, you can write your custom callbacks like normal class and use them in which ever phase you want to invoke the POST methods.

  • Related