问题原因
在macOS通过pip3 install 安装tensorflow(CPU版)后,运行示例代码
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello).decode())
运行之后可以正常输出
“Hello, TensorFlow!”
但是有一个警告警告提示:
I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
在Stack Overflow上面关于这个问题有一个详细的解答
大致翻译一下高赞答案:
Modern CPUs provide a lot of low-level instructions, besides the usual arithmetic and logic, known as extensions, e.g. SSE2, SSE4, AVX, etc. From the Wikipedia:
Advanced Vector Extensions (AVX) are extensions to the x86 instruction set architecture for microprocessors from Intel and AMD pro