win10+anaconda3+tensorflow-gpu一些报错的解决方法

Tensorflow-gpu-2.7.0安装教程和接入PyCharm(学生党详细教程,win10,Anaconda3,python3.9) Tensorflow有cpu和gpu之分,一般你的电脑上要是有GPU(也就是显卡)推荐安装GPU版本的,这样相对于cpu版本而已,运行速度更快!本次教程主要是GPU版本,需要提前下载对应的cuda和cudnn。安装前的必要工作!!!一定要看!!!查看与Python与cuda与cudnn的版本关系,一定要一一对应→打开Tensorflow版本关系查询​操作系统显卡PythonCUDAcuDNNwin103.9.132.7.011.5.28.3.2。 阅读详情

其实这就是个踩坑记录

作为一名苦逼研究生苦苦守在windows系统上,只因为当初买电脑的时候搞了一台无法装ubuntu的Acer.
之前用过一段时间的TensorFlow(https://www.tensorflow.org/), 好在现在已经有了能在windows上使用的tensorflow,甚至通过conda可以直接安装,不过这个版本的tensorflow 是cpu版本的。

先前做过对照测试,同一个训练程序GPU的训练速度大约是CPU的20倍,20倍!!!,所以在尝试了一下之后就决定转战GPU版本的tensorflow。

已经有先驱在Win10+anaconda3安装tensorflow-gpu了,参考这里,写得很详细,基本上按部就班就能安装好。但安装的过程中以及后续的使用中的碰到了一些问题,记一下解决方案。

VS2017

对,我用的是vs2017 community,原因是因为现在vs2015属于旧版本,官网上下载不便(反正我翻了几次没找到2015的)。但是打开CUDA的编译文件夹的时候你会发现它之支持到2015。最后是退而求其次用vs2013编译了对应版本的CUDA,顺利编译。

CUDA与cudnn

现在NVIDIA官网上提供的适配于Win10的安装程序为cuda_8.0.61_win10.exe,和cudnn-8.0-windows10-x64-v6.0

之前那篇教程是将cudnn作为一个附加的组件来安装的,然而实际上,cudnn是必不可少的,否则将无法在 python中import tensorflow

官网提供的是cudnn 6, 在实际使用的时候,会发现现在 cudnn6还存在一个bug, 导致无法顺利import tensorflow。

如果你去查这个“未发现相应模块”的错误,你会在StackFLow上发现有人给出的思路清奇的解决方案:将之前cudnn文件的三个文件夹覆盖过去后再将C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin下的cudnn64_6.dll改成cudnn64_5.dll。还有一堆人点赞。

别信他,这么改虽然能让tensorflow顺利import,但是在实际使用CNN的时候依旧会因为版本问题报错, 正确姿势是去https://developer.nvidia.com/rdp/cudnn-download 选Download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0。

载入替换掉原来在C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin下的cudnn64_5.dll后就可以顺利在python中使用tensorflow自带的CNN功能了。

然而,问题并没有结束
在Tensorflow-gpu使用ImageNet时需要跑个测试, 会发现依旧会报错。

2017-08-06 11:23:17.058978: I c:\tf_jenkins\home
基于Anaconda3配置安装tensorflow(gpu)环境(详细步骤和常见报错) 系统:win10 版本:anaconda3(内置python3.7版)+ tensorflow2.0.0 一、安装anaconda3 1、直接官网https://www.anaconda.com/download/安装内置python3.7的Anaconda,安装点next到底就行。 注意此处两项都要勾选。(第一项是将anaconda路径自动配置为环境变量) 2、安装好后进... 阅读详情

相关推荐

win10下的Tensorflow安装【指定Tensorflow-gpu1.4.0版本】

笔者在win10系统下安装tensorflow也是吃尽了苦头,折腾了许久,参考了很多博客与教程,终于安装成功,分享一下我遇到的问题,希望能造福各位。Attention:以下所有内容仅适配 win10 64位系统+Tensorflow 1.4.01、安装Cuda 8.0首先,不同版本的Tensorflow对应的cuda tookit和cudnn是不同的,所以大家要对应自己安装的tensorflow版...

inkflow的博客 1万+

win10+Anaconda+tensorflow-gpu下启用GPU

win10+Anaconda+tensorflow-gpu下启用GPU加速 背景 由于需要跑深度学习程序,要用到gpu,所以启用GPU加速。 软件和包:1.Anaconda 2.CUDA和CuDNN 3.python 4.TensorFlow-gpu。 版本信息:cuda-V9.0,cudnn-9.0-win10-x64-V7.5.,python-V3.6,tensorflow-gpu-V1...

qq_40947321的博客 2336

Win10 Anaconda下TensorFlow-gpu环境搭建详细教程(包含cuda+cudnn安装过程)

目录 前言 配置环境,研究了一整天,踩了很多坑,在网上找了很多资料,发现基本上都没非常明确的教程,所以今天想分享一下配置tensorflow GPU版本的经验,希望能让各位朋友少走些弯路。(PS:一切的前提,你需要有一张Nvidia显卡。我的显卡是3090) Tensorflow有两个版本:GPU和CPU版本,CPU的很好安装;GPU 版本需要 CUDA 和 cuDNN 的支持,如果你是独显+集显,那么推荐你用GPU版本的,因为GPU对矩阵运算有很好的支持,会加速程序执行!并且CUDA是Nvidia下属的程

cugwangwei的博客 4811

WIN10环境下使用Anaconda 搭建GPU环境

WIN10环境下使用Anaconda 搭建GPU环境 1.PyTorch 1.1确定 pytorch、cuda、cudnn版本的对应关系 如果安装的版本不匹配,安装后会出现各种各样的问题。 本渣踩的坑----安装完成之后,anaconda navigator显示环境已经搭建好,pycharm和jupyter notebook中也能添加pytorch-gpu的编译器,但是在import torch时报错!! OSError: [WinError 126] 找不到指定的模块 一定要匹配! 一定要匹配! 一定

qq_22441151的博客 2963

避坑指南:时间序列互相关分析(CCF)常见的5个误用场景

本文详细解析了时间序列互相关分析(CCF)中常见的5个误用场景,包括忽视平稳性检验、混淆同期相关与因果关联、误读滞后阶数、忽略自相关干扰以及样本量不足等问题。通过实际案例和技术建议,帮助数据分析师避免这些陷阱,确保CCF分析的准确性和可靠性。

weixin_29064009的博客 429

Hi3516CV610 YOLOv8模型转换与部署实战:从源码到板端推理全流程解析

本文详细解析了将YOLOv8模型部署到Hi3516CV610开发板的全流程。内容涵盖从Ubuntu环境搭建、模型获取与验证,到关键的PyTorch模型转换为ONNX格式,并利用海思工具链量化生成板端可执行的.wk文件。最后,指导开发者编写板端C程序,完成视频流处理、NNIE推理及结果后处理,并提供了部署调试与性能优化的实用技巧。

weixin_29215815的博客 271

主题045:四足机器人的运动仿真

四足机器人(Quadruped Robot)是模仿哺乳动物四肢运动设计的机器人系统,具有优异的地形适应性和运动稳定性。与双足机器人相比,四足机器人在静态和动态稳定性方面具有天然优势,能够在复杂地形(如楼梯、斜坡、碎石地面)上稳定行走,因此在野外探索、救援任务、军事应用等领域具有广阔的应用前景。本教程将介绍四足机器人的运动学建模、步态规划、稳定性分析和控制策略,并通过Python仿真验证相关理论。典型的四足机器人每条腿包含3个关节:常见的腿部构型包括:对于单腿,足部位置 pfoot\mathbf{p}_{fo

kkchenjj的博客 684

【YOLO26科研级突破】集成BiFPN双向特征金字塔,让多尺度特征融合效率与精度双跃升

打开确保模型解析器能识别BiFPN模块。通过将BiFPN双向特征金字塔集成到YOLO26中,我们实现了一个“全尺度双向特征流动+加权融合+精准检测”的目标检测模型。这个改进不仅在工程上能大幅提升多尺度、复杂场景下的检测精度,更在科研上提供了“双向特征融合”的创新思路——这种思路可以延伸到其他检测网络(如Faster R-CNN、SSD)的Neck模块改进中,帮你在论文中打造独特的研究点。

LXY_LOVE36的博客 201

DeepSeek Harness“一切皆插件”核心机制详解

DeepSeek Harness 的“一切皆插件”核心 = Cordis 微内核 + 服务化能力接口 + 声明式依赖注入 + 类型化事件 + 可逆副作用 + 配置层 Profile/Bundle/Patch 组合。它的工程收益是:把模型、工具、循环、存储、UI 等所有 Agent 能力都变成“可从配置替换、可干净装卸”的单元,而不是写死在框架里。

软件行业技术文化交流。 604

把 ABAP 采购订单增强做成一条可控流水线:BAdI ME_PROCESS_PO_CUST 全流程实战

摘要: SAP MM模块的ME_PROCESS_PO_CUST BAdI提供了采购订单全生命周期的增强点,覆盖从ME2*N事务到BAPI调用的各类场景。该接口通过INITIALIZE、OPEN、PROCESS_*系列方法、CHECK等组成完整处理流水线,支持字段控制、业务校验、数据派生等功能。关键注意事项包括:PROCESS_*方法仅在相关对象变更时触发、字段控制需区分参考键与动态规则、避免递归调用等。该BAdI采用面向对象设计,通过IF_PURCHASE_ORDER_*等接口操作采购单据对象,而非直接修改

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 407

Whisper 模型在嘈杂环境中的表现:降噪与增强技术

本报告系统分析了OpenAI Whisper模型在嘈杂环境中的表现机制,重点揭示其内在降噪能力的技术边界,并结合语音增强(SE)、时频分析等前沿技术提出优化方案。内容覆盖从基础概念(如噪声类型对ASR的影响)到理论框架(模型架构与数学形式化),再到实际应用(端到端部署策略)的全链路分析,同时通过案例研究与可视化工具(如梅尔频谱对比图)降低复杂概念的认知门槛。核心结论指出:Whisper的多语言预训练虽提升了泛化性,但在低信噪比(SNR<5dB)场景下需结合前端降噪或联合训练技术以突破性能瓶颈。

AI 原生应用开发的博客 489

10款AI工具赋能虚拟展厅设计:架构师效率提升90%的秘密武器

2020年全球疫情成为数字转型的催化剂,虚拟展厅从"可选项"迅速转变为"必需品"。根据Gartner最新报告,到2025年,超过70%的企业将采用虚拟展厅作为客户体验和产品展示的核心渠道。这一转变不仅是应急措施,更是商业模式的永久性革新。虚拟展厅突破了物理空间的限制——一个精心设计的虚拟展厅可以同时接待来自全球各地的访客,无需考虑场地容量;展品可以以数字形式永久保存,避免了物流和损耗问题;数据分析功能可以精确追踪每位访客的行为轨迹,提供前所未有的洞察。数据透视。

AI 领航者的博客 1573

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: Python:用Word2Vec 和 sklearn 对IMDB评论进行分类训练
下一篇: IoT: FIWARE+Docker 城市天气信息收集与可视化( 一)
Nexusis
博客等级 码龄10年 41粉丝 11原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值