在根据教程http://blog.csdn.net/sb19931201/article/details/53648615安装好全部的时候,却无情的给我抛了几个错:

1、AttributeError: module 'tensorflow' has no attribute 'device'

    这貌似是我先pip了tensorflow-gpu的包,再添加cuDnn库。

2、ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 8.0 from this URL: https://developer.nvidia.com/cuda-toolkit

    在下载的CUDA的时候,随手下了9.0的,结果只支持8.0.。

3、ImportError: Could not find 'cudnn64_6.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 6 from this URL: https://developer.nvidia.com/cudnn

    明明看教程的时候写的是5.1版本,我也下的5.1啊,这是为什么?原来是因为我的tensorflow-gpu的版本高于1.3,所以用6.0。

4、InvalidArgumentError (see above for traceback): Cannot assign a device for operation 'add': Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.

[[Node: add = Add[T=DT_FLOAT, _device="/device:GPU:0"](a, b)]]

    还给我弹了下面这个框



这个问题根据下面改就行。

桌面上空白地方右键,进入NVIDIA面板,然后下图



选择第二个,点击应用,再重启电脑即可,记得重启电脑。

我用的以下代码测试:

import tensorflow as tf

# # 通过tf.device将运算指定到特定的设备上。
with tf.device('/cpu:0'):
a = tf.constant([1.0, 2.0, 3.0], shape=[3], name='a')
b = tf.constant([1.0, 2.0, 3.0], shape=[3], name='b')
with tf.device('/gpu:0'):
c=a+b
# 通过log_device_placement参数来记录运行每一个运算的设备。
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c))

Tensorflow之安装GPU版错误集合的更多相关文章

  1. 在windows上极简安装GPU版AI框架(Tensorflow、Pytorch)

    在windows上极简安装GPU版AI框架 如果我们想在windows系统上安装GPU版本的AI框架,比如GPU版本的tesnorflow,通常我们会看到类似下面的安装教程 官方版本 安装CUDA 安 ...

  2. 用MXnet实战深度学习之一:安装GPU版mxnet并跑一个MNIST手写数字识别

    用MXnet实战深度学习之一:安装GPU版mxnet并跑一个MNIST手写数字识别 http://phunter.farbox.com/post/mxnet-tutorial1 用MXnet实战深度学 ...

  3. Anaconda安装tensorflow和keras(gpu版,超详细)

    本人配置:window10+GTX 1650+tensorflow-gpu 1.14+keras-gpu 2.2.5+python 3.6,亲测可行 一.Anaconda安装 直接到清华镜像网站下载( ...

  4. Win10 64bit下安装GPU版Tensorflow+Keras

    Tensorflow和Keras都是支持Python接口的,所以本文中说的都是搭建一个Python的深度学习环境. Keras是对Tensorflow或者Theano的再次封装,也就是以Tensorf ...

  5. 【MindSpore】Ubuntu16.04上成功安装GPU版MindSpore1.0.1

    本文是在宿主机Ubuntu16.04上拉取cuda10.1-cudnn7-ubuntu18.04的镜像,在容器中通过Miniconda3创建python3.7.5的环境并成功安装mindspore_g ...

  6. Windows之vmware安装破解版错误汇总

    A.错误: units specified don't exist, SHSUCDX can't install A.解决: 虚拟机配置->CD/DVD->IDE(0,0) B:错误: n ...

  7. Windows 2012服务器安装GPU版TensorFlow完全攻略

    一.首先,推荐用Anaconda安装 因为Anaconda本身就已经默认安装了很多常用的Python库,可以省去大量的库安装过程,并且解决兼容性问题. Anaconda本身的安装也非常简单,搜索Ana ...

  8. [tensorflow]的安装

    1 pip install 最简单直接的方法,通过pip install安装,命令如下: pip install tensorflow-gpu //安装gpu版tensorflow pip insta ...

  9. Win10 + Python + GPU版MXNet + VS2015 + RTools + R配置

    最近入手一台GTX 1070的笔记本,手痒想在win10上试下GPU跑模型,所以就有了接下来的安装GPU版mxnet的坎坷历程,经过多重试验终于搞定了python和R安装mxnet,现将主要点记录如下 ...

随机推荐

  1. May 16th 2017 Week 20th Tuesday

    The most fearful enemy is not having a firm conviction. 最可怕的敌人,就是没有坚强的信念. A firm conviction or belie ...

  2. TOEFL考试(一年半的复仇,裸考)

    8/11/2018 had a TOEFL test without preparation. Reading (worry about too much, not familiar with the ...

  3. Gym 101334C 无向仙人掌

    给出图,求他的“仙人掌度”,即求包括他自身的生成子图有多少? 只能删去仙人掌上的叶子的一条边,然后根据乘法原理相乘: 1.怎么求一个仙人掌叶子上有多少边? 可以利用点,边双连通的时间戳这个概念,但是绝 ...

  4. ACM/ICPC 2018亚洲区预选赛北京赛站网络赛 A、Saving Tang Monk II 【状态搜索】

    任意门:http://hihocoder.com/problemset/problem/1828 Saving Tang Monk II 时间限制:1000ms 单点时限:1000ms 内存限制:25 ...

  5. 2018.11.22 mac中"允许所有安装来源"的命令 & Mac窗口标题显示文件的路径

    当Mac遇到软件无法安装或者此文件已经损坏之类的时候 原因是软件为破解版,地址来源已改变,被系统拦截了,解决办法就是直接在终端中输入"sudo spctl --master-disable ...

  6. Softmax vs. Softmax-Loss: Numerical Stability

    http://freemind.pluskid.org/machine-learning/softmax-vs-softmax-loss-numerical-stability/ softmax 在 ...

  7. JavaScript:改变 HTML 内容

    使用Javascript来处理HTML元素的内容是非常强大的功能. <!DOCTYPE html><html><head><meta http-equiv=& ...

  8. 表达式过滤器 lowercase

    <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...

  9. LeetCode8.字符串转换整数(atoi) JavaScript

    请你来实现一个 atoi 函数,使其能将字符串转换成整数. 首先,该函数会根据需要丢弃无用的开头空格字符,直到寻找到第一个非空格的字符为止. 当我们寻找到的第一个非空字符为正或者负号时,则将该符号与之 ...

  10. Java基础——线程复习总结

                                                                                                    线程 T ...