实验环境

ubuntu18
NVIDIA GeForce GTX 1050
CUDA11.0
CUDNN 8.0
Tesorflow-gpu 2.4.1

问题

分析原因
据说是Tesorflow-gpu 2.4.1,默认情况下,不再注册XLA:CPU和XLA:GPU设备。如果确实需要它们,请可使用

os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'

但是此标志最终将在后续发行版中删除。

解决方法

import tensorflow as tf
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'print(tf.__version__)
a = tf.constant(1.)
b = tf.constant(2.)
print(a+b)
print('GPU:', tf.test.is_gpu_available())

改为

import tensorflow as tf
import os
os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
print(tf.__version__)
a = tf.constant(1.)
b = tf.constant(2.)
print(a+b)
print('GPU:', tf.test.is_gpu_available())

即可


你将会发现,在代码开头加了

os.environ['TF_XLA_FLAGS'] = '--tf_xla_enable_xla_devices'

将不会有

Not creating XLA devices, tf_xla_enable_xla_devices not set

提示!

Ubuntu18解决:Not creating XLA devices, tf_xla_enable_xla_devices not set相关推荐

  1. 解决:Not creating XLA devices, tf_xla_enable_xla_devices not set

    解决:Not creating XLA devices, tf_xla_enable_xla_devices not set 实验环境 提示如下 分析原因 解决方法 实验环境 Windows 10 N ...

  2. win10系统tensorflow2.4.0-gpu安装“Not creating XLA devices, tf_xla_enable_xla_devices not set”解决方法

    未解决前报错   最近在安装tensorflow2.4.0-gpu版本后的项目开发过程中出现了"Not creating XLA devices, tf_xla_enable_xla_dev ...

  3. 【Error】解决:Not creating XLA devices, tf_xla_enable_xla_devices not set

    提示如下 分析原因 据说是Tesorflow-gpu 2.4.1,默认情况下,不再注册XLA:CPU和XLA:GPU设备.如果确实需要它们,请可使用 os.environ['TF_XLA_FLAGS' ...

  4. 彻底解决conda环境下 tensorflow gpu版本出现的问题:Not creating XLA devices, tf_xla_enable_xla_devices not set

    问题说明 tf.test.is_gpu_available()结果为TRUE,但有Not creating XLA devices, tf_xla_enable_xla_devices not set ...

  5. 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_d ...

  6. Linux conda tensorflow-gpu安装及Not creating XLA devices, tf_xla_enable_xla_devices not set相关问题解决

    0.首先介绍一下conda创建虚拟环境的基本操作. (1)创建Python的虚拟环境,并指定Python版本,不指定的话会使用默认的版本(Conda Base 环境中的Python版本). conda ...

  7. 安装Tensorflow 报错false Not creating XLA devices, tf_xla_enable_xla_devices not set

    学习图像识别配置环境 https://blog.csdn.net/weixin_44170512/article/details/103990592 一步一步按照博主配置 执行到这两句 import ...

  8. Not creating XLA devices, tf_xla_enable_xla_devices not set错误求助

    在pycharm中跑代码出现 在调试的时候出现了Not creating XLA devices, tf_xla_enable_xla_devices not set,但是测试的时候却是显示true ...

  9. CUDA安装 + tensorflow gpu版本出现的问题:Not creating XLA devices, tf_xla_enable_xla_devices not set

    装完后用以下两行代码测试,结果竟然是False,输出了图片中的报错,肯定是哪装的有问题 import tensorflow as tf tf.test.is_gpu_available() 我的ten ...

最新文章

  1. Linux驱动框架之framebuffer驱动框架
  2. MyEclipse中删除对Struts、hibernate、spring的支持
  3. 详解SQL Server连接(内连接、外连接、交叉连接)
  4. AI加剧贫富分化不可避免,我们的职业会发生哪些变化?
  5. 手机web——自适应网页设计(html/css控制) - 51CTO.COM
  6. java学习(3):学生管理系统3
  7. Mac OS X 完全卸载MySQL
  8. java 文件比对(四)-- 使用 diffutils
  9. 杀软和防火墙简单列表
  10. 为什么很多开发都要转测试....详谈....
  11. 计算机系统时间错了,电脑时间同步出错怎么办
  12. Qt creator开发的C++应用程序运行崩溃,异常代码0xc0000409,错误偏移量0x0009efbb解决。
  13. 新手如何做自媒体赚钱?天天看头条却不赚钱,这份资料对你有启发
  14. 计算机日历算法流程图,计算机日历
  15. mac电脑usb连接android手机,Android安卓设备连接Mac的方法
  16. 神经网络整合算法是什么,神经网络整合算法实例
  17. Twitter 账号爬取
  18. 【OpenCV入门教程之十七】OpenCV重映射 SURF特征点检测合辑
  19. yml和properties的区别
  20. 简单响应式Bootstrap框架中文官网页面模板

热门文章

  1. 2013 【第四届蓝桥杯省赛】 C/C++ B组
  2. CSS:line-height是什么?,height是什么?
  3. Shiro-SpringBoot (一)
  4. 【opencv-python不规则多边形 ROI提取】
  5. 备婚倒数日或纪念日记录的提醒APP
  6. 直播带货那么火,测试人员如何对直播类产品的直播质量进行测试呢?
  7. Android之集成极光推送消息
  8. 考PMP需要多少钱?
  9. ECDH secp256k1 集成
  10. 编译Android环境的libjpeg-turbo