如何使用编译器标志重建tensorflow?

brc7rcf0  于 2022-12-04  发布在  其他
关注(0)|答案(1)|浏览(232)

我正在尝试用tensorflow后端运行二进制分类,但我一直收到一个错误,我相信它要求我用正确的编译器标志重建tensorflow。我知道我的代码和数据是功能性的,所以我认为问题是与虚拟环境有关。我已经尝试在tensorflow的网站,ibm的网站和堆栈溢出上找到解决方案,但我没有成功。我也尝试重新安装tensorflow和python。
完整追溯:
I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
虚拟环境信息:

  • 使用水蟒环境
    -Python 3.7.9版
  • tensorflow 2.4.1
pkwftd7m

pkwftd7m1#

我把这些警告藏起来:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

请注意,这不会重新构建TensorFlow,而只是隐藏警告。
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

相关问题