From the course: Full-Stack Deep Learning with Python

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Training a model within an MLflow run

Training a model within an MLflow run - Python Tutorial

From the course: Full-Stack Deep Learning with Python

Training a model within an MLflow run

With our model configured, now it's time for us to train the model and track the metrics, parameters, and artifacts of this model using MLflow. Notice the imports on lines 1, 2, and 3. These are imports that have to do with logging all of the details of the model, including the model signature, the schema, and tensor specifications of the tensors that we feed into the model. I instantiate the model on line 5, that is our EMNIST model. And on line seven, I instantiate the CSV logger. The CSV logger is what we'll use to log out details of the training process to our local machine. The actual training process will be run using the PyTorch Lightning Trainer that I instantiate on line nine. We'll train for a maximum of 10 epochs. And notice I pass in the CSV logger as an input argument so that the trainer can use that logger to log out details during training. Now, MLflow can track parameters and metrics in a very granular and manual fashion by calling log metrics, log params, as you saw…

Contents