Search code examples
python-3.xtensorflowkerasgpuamd-gpu

Setting up Keras and TensoFlow to operate with AMD GPU


I am trying to set up Keras in order to run models using my GPU. I have a Radeon RX580 and am running Windows 10.

I saw realized that CUDA only supports NVIDIA GPUs and was having difficulty finding a way to get my code to run on the GPU. I tried downloading and setting up plaidml but afterwards

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

only printed that I was running on a CPU and there was not a GPU available even though the plaidml setup was a success. I have read that PyOpenCl is needed but have not gotten a clear answer as to why or to what capacity. Does anyone know how to set up this AMD GPU to work properly?


Solution

  • To the best of my knowledge, PlaidML was not working because I did not have the required prerequisites such as OpenCL. Once I downloaded the Visual Studio C++ build tools in order to install PyopenCL from a .whl file. This seemed to resolve the issue