When we are running a pytorch mode, we may get this error: CUDA error: no kernel image is available for execution on the device. In this tutorial, we will introduce you how to fix.
This error may look like:
Why does this error occur?
If you run code below, you may get more information.
Because your cuda version is not suitable your gpu, you need to reintall cuda and pytorch.
In order to what cuda version you should install, you can refer this tutorial.
Check Your GPU is Suitable for TensorFlow or not: A Step Guide – TensorFlow Tutorial
or check what cuda version has been installed, you can check: