gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 08:08:37 27 4
gpt4 key购买 nike

我正在尝试使用 tensorflow 后端运行二进制分类,但我一直收到一个错误,我认为该错误要求我使用正确的编译器标志重建 tensorflow。我知道我的代码和数据在功能上是有效的,所以我认为问题出在虚拟环境上。我曾尝试在tensorflow的网站、ibm的网站和stackoverflow上寻找解决方案,但都没有成功。我也试过重新安装 tensorflow 和 python。
完整追溯:I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not setI 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 FMATo enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.虚拟环境信息:
- 使用 anaconda 环境
-Python 3.7.9
- tensorflow 2.4.1

最佳答案

我解决了:

    import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

关于python - 如何使用编译器标志重建 tensorflow?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66092421/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com