AssertionError: Torch not compiled with CUDA enabled error

I’m not able to run pytorch with cuda even after installing with cuda enabled
I used this command for installing
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
nvidia-smi is showing GPU with cuda 10.2 version.
I’ve tried uninstalling and installing again but no luck

Could you create a new virtual environment and reinstall PyTorch?
The error message suggests that the currently found installation doesn’t ship with the CUDA runtime, so you might have multiple (old) installs in the current env.

@ptrblck Thankyou. That worked