It won’t be possible to run the code on the GPU after removing all to('cuda') and cuda() calls.
@wiTTyMinds_Technolog got the error, since he does not have a GPU and somewhere in the script the tensors or model were still being pushed to the device.
The original error message points to a CUDA call, which wasn’t compiled for the current GPU architecture.
Are you running some custom CUDA extensions, did you build PyTorch from source, and which GPU are you using?