Saving a trained tabular model
So far, we have trained a series of fastai deep learning models on tabular datasets. These models are available to us in the Python session where we train the model, but what can we do to save the models so that we can use them later in a different session? In this recipe, we will learn how to save a fastai deep learning model to a file and access that model in another Python session.
Getting ready
Ensure you have followed the steps in Chapter 1, Getting Started with fastai, to get a fastai environment set up. Confirm that you can open the saving_models_trained_with_tabular_datasets.ipynb
and loading_saved_models_trained_with_tabular_datasets.ipynb
notebooks in the ch3
directory of your repository.
How to do it…
In this recipe, you will be running through the saving_models_trained_with_tabular_datasets.ipynb
notebook to train a model – the same model that you trained in the first recipe of this chapter – and save it. Then...