Cannot force usage of CPU in flask server

Got it!

This thread mentioned that I need to use learn.to and .cpu to set the learner and dataloaders to use the CPU post-training.

learn.to('cpu')
learn.dls.cpu()
torch.save(learn.dls, 'models/dls-v0-0-1')