I’ve trained a model using fast.ai v1. I now want to deploy the model and run predictions but only on CPU.
I’ve tried the following which is taken from this topic. The code looks like:
learn.model.training = False
learn.model = learn.model.cpu()
When I attempt to obtain a prediction:
I get the following error:
RuntimeError: Expected object of backend CPU but got backend CUDA for argument #3 ‘index’
Any idea how to resolve the error?