深度学习环境配置

last modify

Mac (Apple Silicon)

TensorFlow

Tensorflow Plugin - Metal - Apple Developer

$ # 2022年07月20日
$ # python -m pip install -U pip
$ conda install -c apple tensorflow-deps -y
$ python -m pip install tensorflow-macos
$ python -m pip install tensorflow-metal

ImportError: numpy.core.xxx

ImportError: numpy.core._multiarray_umath failed to import · Issue #11871 · numpy/numpy

更新 numpy 版本即可

  • 【2022.07.21】在 tensorflow-macos==2.9.2 下推荐 numpy==1.22.4(与 scipy、numba 等库兼容)

$ pip uninstall numpy
$ pip install tensorflow-macos

sentencepiece 安装问题

2022年07月20日,sentencepiece-0.1.96

  • Transformers 的 Tokenizer 模块依赖该库,直接安装失败;

  • 解决方案:

    Add Mac M1 Compatibility · Issue #608 · google/sentencepiece

    • 安装 brew

    • 安装 cmake:brew install cmake

    • 安装 pkgconfig:brew install pkgconfig

    • 安装 sentencepiece:pip install sentencepiece

  • 官方提供的源码安装方案

    https://github.com/google/sentencepiece#build-and-install-sentencepiece-command-line-tools-from-c-source

Last updated