python - 如何使用编译器标志重建 tensorflow?
问题描述
我正在尝试使用 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 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.
虚拟环境信息:
- 使用 anaconda 环境
-Python 3.7.9
-张量流 2.4.1
解决方案
我解决了:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
推荐阅读
- c# - 访问服务 api 在 kubernete 中暴露为 clusterIP
- css - react native back ImageBackground 居中
- python - 更改副本列表一些新值影响源列表
- sql - 将两列与同一个表进行比较以删除重复项
- c - 使用 ascii 代码将字符串数组转换为数组
- concatenation - 在 power bi 中连接另外两个表
- c++ - 关于删除动态对象数组
- excel - 如果范围内的单元格已更新,则使用日期更新 excel 单元格
- python - 动态创建一个派生自 ABC 类的类
- android - 如何在颤动中对折线图中的x和y轴进行排序