赞
踩
anaconda安装完虚拟环境,配置好TensorFlow后,不支持import tensorflow,会报硬件错误,具体原因我也不清楚,看了教程说用miniforge3可以兼容,但是看了很多教程弄了一天还是失败,最头疼的是安装TensorFlow各种依赖的时候报各种错。
如果你看了国内的各种方案配置的miniforge3还失败了,建议直接删除用户目录下的miniforge3,然后根据以下方法配置。
https://developer.apple.com/metal/tensorflow-plugin/
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
conda install -c apple tensorflow-deps
# uninstall existing tensorflow-macos and tensorflow-metal
python -m pip uninstall tensorflow-macos
python -m pip uninstall tensorflow-metal
# Upgrade tensorflow-deps
conda install -c apple tensorflow-deps --force-reinstall
# or point to specific conda environment
conda install -c apple tensorflow-deps --force-reinstall -n my_env
For v2.5:
conda install -c apple tensorflow-deps==2.5.0
For v2.6:
conda install -c apple tensorflow-deps==2.6.0
NOTE: python versions 3.8 and 3.9 supported
python -m pip install tensorflow-macos
Install tensorflow-metal plugin
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。