The weights need to be saved in CPU format in order to be read and displayed by the last code block because the last code block runs only on CPU. This code change makes it possible to save the weights in CPU format even when the training phase is run on a GPU enabled environment.
The weights need to be saved in CPU format in order to be read and displayed by the last code block because the last code block runs only on CPU. This code change makes it possible to save the weights in CPU format even when the training phase is run on a GPU enabled environment.