按照官网步骤执行:
https://developer.apple.com/metal/tensorflow-plugin/
import tensorflow as tf 报错:
miniforge3/lib/python3.10/site-packages/numpy/core/../../../../libcblas.3.dylib' (no such file), '/Users/wanglong/miniforge3/lib/python3.10/site-packages/numpy/core/../../../../libcblas.3.dylib' (no such file)
miniforge3/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (__ZNK6google8protobuf10TextFormat21FastFieldValuePrinter19PrintMessageContentERKNS0_7MessageEiibPNS1_17BaseTextGeneratorE)
解决方式:
conda install openblas
conda uninstall numpy
conda install numpy
pip3 install protobuf==3.19.4
参考:
Can´t use tensorflow on Macbook Ai… | Apple Developer Forums