官方教程链接https://developer.apple.com/metal/tensorflow-plugin/
1.安装虚拟环境在这里我使用conda,也可以用其他的
conda create -n tf-metal-2.6 python=3.8 2.激活虚拟环境 conda activate tf-metal-2.6 3.安装tensorflow-macos和tensorflow-metal pip install tensorflow-macos tensorflow-metal如果你是macOS12,可能识别不到你的型号,报错not a supported wheel on this platform
前面加上SYSTEM_VERSION_COMPAT=0
SYSTEM_VERSION_COMPAT=0 pip install tensorflow-macos tensorflow-metal 至此,大功告成!!