How to use `learn.TTA` on CPU

I have 1 GPU, and my 1 notebook is using almost 95% of my GPU RAM. I already have a second model trained and ready. Now I want to do predictions on the test set with learn.TTA

preds, avg_pred, y = learn.TTA(beta=None, scale=1.05, ds_type=DatasetType.Test)

I tried to move my data which I am using in create_cnn to cpu with data.device=torch.device('cpu') but I am receiving error and learn.TTA is still using GPU.

So how can I use learn.TTA on pretrained model weights on CPU.


My guess would be that your model is still on the GPU. You need to move that to the CPU as well.

@KarlH How do I do that? I tried _ = learn.model.cpu() but still it is failing.