You may check out this documentaion
Here below some information about learn.purge()
extracted from this discussion
-
learn.purge()
removes any of the Learner guts that are no longer needed and reloads the model on GPU, which also helps to reduce memory fragmentation -
Run
learn.purge()
before any big change in your model training (image size, unfreeze, etc.).