2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

M1 MacでTensorFlowをインストールする際の注意事項

Last updated at Posted at 2021-12-11

M1 MacでTensorFlowをインストールする際の注意事項

M1 MacでTensorFlowをインストールする場合、tensorflow-macosをpipに指定します。ただ、その場合HDF5関連のライブラリが見つからないというエラーになることがあります。

その場合は、以下のようにbrewでhdf5をインストールし、HDF5_DIRの環境変数を設定すると正常にインストールできます。

brew install hdf5@1.8
export HDF5_DIR=/opt/homebrew/Cellar/hdf5@1.8/1.8.22_2

pip install tensorflow-macos

tensorflow-macosのインストール時にgrpcioのコンパイルでエラーになる場合は、以下で対応できるかもしれません。

export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1

pip install grpcio

参考文献

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?