[英]Grpcio fails installation for Tensorflow 2.5 on arm64 Apple Silicon
I'm following the instructions here: https://developer.apple.com/metal/tensorflow-plugin/ and having issues installing grpcio.我按照此处的说明进行操作: https://developer.apple.com/metal/tensorflow-plugin/并且在安装 grpcio 时遇到问题。 When I try python -m pip install tensorflow-macos
I get:当我尝试python -m pip install tensorflow-macos
我得到:
AssertionError: would build wheel with unsupported tag ('cp39', 'cp39', 'macosx_11_0_arm64')
----------------------------------------
ERROR: Failed building wheel for grpcio
The subsequent attempt also ends in an error:随后的尝试也以错误结束:
Running setup.py clean for grpcio
Failed to build grpcio
Installing collected packages: grpcio, tensorflow-estimator, keras-nightly, flatbuffers
Attempting uninstall: grpcio
Found existing installation: grpcio 1.38.1
Uninstalling grpcio-1.38.1:
Successfully uninstalled grpcio-1.38.1
Running setup.py install for grpcio ... error
The solutions given here: How can I install GRPCIO on an Apple M1 Silicon laptop?此处给出的解决方案: How can I install GRPCIO on an Apple M1 Silicon laptop? have unfortunately not worked to me.不幸的是对我没有用。
I am quite inexperienced with architecture/chip challenges, but it reads that the arm64 is currently not supported?我对架构/芯片挑战没有经验,但它显示当前不支持 arm64? If that is the case it is odd that it is included in the tensorflow_plugin steps.如果是这种情况,那么奇怪的是它包含在 tensorflow_plugin 步骤中。 Any thoughts on what I am doing wrong would be appreciated.对我做错了什么的任何想法将不胜感激。
What helped me was:对我有帮助的是:
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 python -m pip install tensorflow-macos
I had to我不得不
boringssl
manually ( github answer )手动构建boringssl
( github 回答)grpcio
as explained in the previous answer如上一个答案中所述,在安装grpcio
时使用标志# The following are required to locally build boringssl
brew install go
brew install wget
brew install cmake
mkdir boringssl
cd boringssl
wget https://boringssl.googlesource.com/boringssl/+archive/master.tar.gz
gunzip -c master.tar.gz | tar xopf -
mkdir build
cd build
cmake ..
make
# Install `grpcio` with the right
YCFLAGS="-I /opt/homebrew/opt/openssl/include" LDFLAGS="-L /opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install 'grpcio'
pip install tensorflow-macos
# If you see an error like below then upgrade numpy
#
# TypeError: Unable to convert function return value to a Python type! The signature was () -> handle
pip install numpy --upgrade
python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.