tensorflow:Not creating XLA devices, tf_xla_enable_xla_devices not set

运行代码出现
I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set

以为是网上说的CUDA tensorflow-gpu 版本的问题
可看后面,gpu还是正常运行了的
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1720] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce RTX 2060 with Max-Q Design computeCapability: 7.5
coreClock: 1.185GHz coreCount: 30 deviceMemorySize: 6.00GiB deviceMemoryBandwidth: 245.91GiB/s
在这里插入图片描述查了查 tensorflow前面的那个“I”是 information log message的意思,不算是error,程序还是可以正常运行的

那怎么把这碍眼的东西解决呢?
解决方法参考:https://stackoverflow.com/questions/65907365/tensorflow-not-creating-xla-devices-tf-xla-enable-xla-devices-not-set

第一种方法:在代码开头加一行:
os.environ[‘TF_XLA_FLAGS’] = ‘–tf_xla_enable_xla_devices’

第二种方法:添加windows系统环境变量
TF_XLA_FLAGS = --tf_xla_enable_xla_devices.

本人使用第一种方法解决。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值