我在 python 中使用了 plaidml,但我的 GPU 没有运行 我使用 Macbook Pro 16, 2019

问题描述

我按照以下说明操作: https://plaidml.github.io/plaidml/docs/install#macos

并运行以

开头的代码
from os import environ
environ["KERAS_BACKEND"] = "plaidml.keras.backend"


import keras
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam

设置好使用哪个GPU后

Default Config Devices:
   llvm_cpu.0 : cpu (via LLVM)
   Metal_intel(r)_uhd_graphics_630.0 : Intel(R) UHD Graphics 630 (Metal)
   Metal_amd_radeon_pro_5300m.0 : AMD Radeon Pro 5300M (Metal)

Experimental Config Devices:
   llvm_cpu.0 : cpu (via LLVM)
   opencl_amd_radeon_pro_5300m_compute_engine.0 : AMD AMD Radeon Pro 5300M Compute Engine (OpenCL)
   Metal_intel(r)_uhd_graphics_630.0 : Intel(R) UHD Graphics 630 (Metal)
   opencl_intel_uhd_graphics_630.0 : Intel Inc. Intel(R) UHD Graphics 630 (OpenCL)
   Metal_amd_radeon_pro_5300m.0 : AMD Radeon Pro 5300M (Metal)

Using experimental devices can cause poor performance,crashes,and other nastiness.

Enable experimental device support? (y,n)[n]:y

Multiple devices detected (You can override by setting PLAIDML_DEVICE_IDS).
Please choose a default device:

   1 : llvm_cpu.0
   2 : opencl_amd_radeon_pro_5300m_compute_engine.0
   3 : Metal_intel(r)_uhd_graphics_630.0
   4 : opencl_intel_uhd_graphics_630.0
   5 : Metal_amd_radeon_pro_5300m.0

Default device? (1,2,3,4,5)[1]:2

Selected device:
    opencl_amd_radeon_pro_5300m_compute_engine.0

Almost done. Multiplying some matrices...
Tile code:
  function (B[X,Z],C[Z,Y]) -> (A) { A[x,y : X,Y] = +(B[x,z] * C[z,y]); }
Whew. That worked.```


I ran the jupyter notebook and codes the shell showed

(plaidml-venv) tom@TomdeMacBook-Pro ~ % jupyter notebook
[I 00:33:57.459 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.1
[I 00:33:57.460 NotebookApp] Serving notebooks from local directory: /Users/tom
[I 00:33:57.460 NotebookApp] The Jupyter Notebook is running at:
....
....
[I 00:34:14.427 NotebookApp] Kernel started: 85afcfbd-f2a5-4c2a-b5ef-0b5d2bd13c67
[I 00:34:21.789 NotebookApp] Starting buffering for 85afcfbd-f2a5-4c2a-b5ef-0b5d2bd13c67:2e235bb3866a4a8785f81f761cca51b7
[I 00:34:22.002 NotebookApp] Kernel restarted: 85afcfbd-f2a5-4c2a-b5ef-0b5d2bd13c67
[I 00:34:22.461 NotebookApp] Restoring connection for 85afcfbd-f2a5-4c2a-b5ef-0b5d2bd13c67:2e235bb3866a4a8785f81f761cca51b7
[I 00:34:22.461 NotebookApp] Replaying 3 buffered messages
2021-05-05 00:34:27.072860: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices,tf_xla_enable_xla_devices not set
2021-05-05 00:34:27.073059: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (onednN) to use the following cpu instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations,rebuild TensorFlow with the appropriate compiler flags.
2021-05-05 00:34:30.750011: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)

我选择作为目标的 AMD GPU 没有显示任何活动。

enter image description here 你能帮我吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...