From the course: Deep Learning: Image Recognition

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Training a neural network and saving weights

Training a neural network and saving weights - Python Tutorial

From the course: Deep Learning: Image Recognition

Start my 1-month free trial

Training a neural network and saving weights

- [Instructor] When we train a neural network, we wanna make sure that we save the results, so that we can reuse the trained model later. Let's learn how to train our neural network and save the results to a file. Open up 02 training and saving weights dot py. Here on line eight, we've already written the code to load our dataset, and then we've coded our neural network. And then on line 39, we've compiled it. And on line 46, we've started the training process. But after training completes, we wanna save the trained neural network to a file so we'll be able to use it to recognize objects and images in other programs. Let's start that on line 56. Saving a neural network is two separate steps. First, we wanna save the structure of the neural network itself. That includes which layers get created and the order that they're hooked together. We could rewrite the neural network code again from scratch each time we use it, but it's a lot easier to save the structure to a file and just load…

Contents