禁用GPU版本TensorFlow,切换到CPU版本TensorFlow。
#禁用gpu版本TensorFlow,因为CUDA号码从0开始,这里直接让CUDA使用-1的GPU,自然就无法使用gpu了。
代码前面加入:
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1"
import tensorflow as tf
Environment Variable Syntax Results
CUDA_VISIBLE_DEVICES=1 Only device 1 will be seen
CUDA_VISIBLE_DEVICES=0,1 Devices 0 and 1 will be visible
CUDA_VISIBLE_DEVICES="0,1" Same as above, quotation marks are optional
CUDA_VISIBLE_DEVICES=0,2,3 Devices 0, 2, 3 will be visible; device 1 is masked
如果安装了GPU,默认使用GPU版本的TensorFlow
---------------------
作者:湾区人工智能
来源:CSDN
原文:https://blog.csdn.net/BTUJACK/article/details/82622966
版权声明:本文为博主原创文章,转载请附上博文链接!
禁用GPU版本TensorFlow,切换到CPU版本TensorFlow。的更多相关文章
- centos7 源码编译安装TensorFlow CPU 版本
一.前言 我们都知道,普通使用pip安装的TensorFlow是万金油版本,当你运行的时候,会提示你不是当前电脑中最优的版本,特别是CPU版本,没有使用指令集优化会让TensorFlow用起来更慢. ...
- windows10(64位)Anaconda3+Python3.6搭建Tensorflow(cpu版本)及keras
转自:windows10(64位)Anaconda3+Python3.6搭建Tensorflow(cpu版本)及keras 1.本来电脑安装的是anaconda3 5.3.1,但安装的python版本 ...
- TensorFlow在Windows上的CPU版本和GPU版本的安装指南(亲测有效)
安装说明 平台:Window.Ubuntu.Mac等操作系统 版本:支持GPU版本和CPU版本 安装方式:pip方式.Anaconda方式 attention: 在Windows上目前支持python ...
- 查看 tensorflow 是GPU版本 还是CPU版本
在Python环境中输入: import os from tensorflow.python.client import device_lib os.environ["TF_CPP_MIN_ ...
- 安装WIN7/WIN10上的 CPU版本的TensorFlow
随手记 ancaconda Anaconda2-5.0.1-Windows-x86_64(python3.5 ancaconda python-3.5.2-amd64 安装TensorFlow的时候自 ...
- 学习笔记TF046:TensoFlow开发环境,Mac、Ubuntu/Linux、Windows,CPU版本、GPU版本
下载TensorFlow https://github.com/tensorflow/tensorflow/tree/v1.1.0 .Tags选择版本,下载解压. pip安装.pip,Python包管 ...
- Windows7 64bits下安装TensorFlow CPU版本(图文详解)
不多说,直接上干货! Installing TensorFlow on Windows的官网 https://www.tensorflow.org/install/install_windows 首先 ...
- faiss CPU版本+GPU版本安装
faiss安装 faiss是facebook开发的有CPU版本和GPU版本的求密集向量相似性和进行密集向量聚类的库. faiss用c++编写,安装faiss需要在github上下载其c++源码并用ma ...
- 虚拟机 Ubuntu18.04 tensorflow cpu 版本
虚拟机 Ubuntu18.04 tensorflow cpu 版本 虚拟机VMware 配置: 20G容量,可扩充 2G内存,可扩充 网络采用NAT模式 平台:win10下的Ubuntu18.04 出 ...
随机推荐
- 小米网关api
http://bbs.xiaomi.cn/t-13198850 https://github.com/snOOrz/homebridge-aqara/blob/master/README.md htt ...
- Hdu 1150
Machine Schedule Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...
- django1.11启动错误
错误信息: 复制代码 Unhandled exception in thread started by <function check_errors..wrapper at 0x10f03b8c ...
- list reverse
You can make use of the reversed function for this as: >>> array=[0,10,20,40] >>> ...
- UE4 Pak 相关知识总结
转载自:https://arcecho.github.io/2017/07/02/UE4-Pak-%E7%9B%B8%E5%85%B3%E7%9F%A5%E8%AF%86%E6%80%BB%E7%BB ...
- 弘康人寿基于 RocketMQ 构建微服务边界总线的实践
随着互联网+和平台化战略的兴起,各个行业的 IT 系统都在向互联网架构发展,涉及的主要技术包括微服务.消息和弹性计算等,采用微服务架构实现服务高内聚.低耦合,通过异步消息完成交易快速响应和高并发.由于 ...
- 第一次作业:reading and prepare
这个作业属于哪个课程 课程的链接 这个作业要求在哪里 作业要求的链接 我在这个课程的目标是 理解软件开发流程,更好的开发自己的软件 这个作业在哪个具体方面帮助我实现目标 对"工程" ...
- Directx11教程(15) D3D11管线(4)
原文:Directx11教程(15) D3D11管线(4) 本章我们首先了解一下D3D11中的逻辑管线,认识一下管线中每个stage的含义. 参考资料:http://fgiesen.wordpress ...
- SDUT-2498_AOE网上的关键路径
数据结构实验之图论十一:AOE网上的关键路径 Time Limit: 2000 ms Memory Limit: 65536 KiB Problem Description 一个无环的有向图称为无环图 ...
- hdu1848 sg打表
果然是神器. #include<stdio.h> #include<string.h> #define maxn 1002 ],sg[maxn],hash[maxn]; voi ...