I have a MacBook Pro with AMD processor and I want to run Keras (Tensorflow backend) in this GPU. I came to know Keras only works with NVIDIA GPUs. What is the workaround (if possible)?
相关问题
- batch_dot with variable batch size in Keras
- How to use Reshape keras layer with two None dimen
- Why keras use “call” instead of __call__?
- How to conditionally scale values in Keras Lambda
- neural network does not learn (loss stays the same
相关文章
- Tensorflow: device CUDA:0 not supported by XLA ser
- Change loss function dynamically during training i
- Error occurred when finalizing GeneratorDataset it
- Why does this Keras model require over 6GB of memo
- How to measure overfitting when train and validati
- keras model subclassing examples
- How to disable keras warnings?
- ValueError: Unknown metric function when using cus
You can OpenCL library to overcome this. I have tested it and it is working fine for me.
Note: I have python version 3.7 and I will be using pip3 for package installation.
Steps:
Install OpenCL package with the following command
Install PlaidML library using following command
Run setup for PlaidML. While setup you might get a prompt to select your GPU. If setup went correctly, you will get a success message at the end.
Install plaidbench to test plaidml on your GPU.
Test it. If everything went well till here you will get benchmark scores.
Now we have to set an environment path. Put this at the top of your code.
keras
instead oftensorflow.keras
in your code and run the following. (keras is installed in step 2 which runs in GPU)When you run this you will get
which confirms that you are running it in GPU.
Reference: https://towardsdatascience.com/gpu-accelerated-machine-learning-on-macos-48d53ef1b545