首页 > 解决方案 > 运行时Tensorflow重建警告

问题描述

我已经通过 pip 安装了 tensorflow,它显示它已正确下载并安装,但是当我运行代码时,它显示使用正确的编译器标志重建它。

This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) 
to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.


tf.Tensor(-1883.2466, shape=(), dtype=float32)

上面的输出是我在运行此代码时得到的错误:

import tensorflow as tf
print(tf.reduce_sum(tf.random.normal([1000, 1000]))) 

是bug还是什么,请帮忙,因为我正在尝试学习深度学习

标签: pythontensorflow

解决方案


该警告并未抱怨未启用 AVX。这只是一条信息性消息,仅针对某些操作,将使用英特尔的 oneDNN,并打开 AVX 或 AVX2。

请按照https://software.intel.com/content/www/us/en/develop/articles/intel-optimization-for-tensorflow-installation-guide.html的要求添加标签“comp:mkl”


推荐阅读