记录一下:

报错:# Error : Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above 

  

由于我用的是Flask框,在各个py文件之间相互引用、调用的过程中,可能会存在文件、模块先后顺序的问题,导致一系列的问题;

因为我需要在flask框架中全局加载一次模型,进行多次预测,所以在框架初始化的时候,就需要load_model,之后在接口中进行预测,这就可能会导致一个问题是:是否能够保持模型和预测内容在一个会话中。

从网上查找了一些方法之后,如果没有解耦,直接在一个视图函数中完成一系列的操作(不推荐,新手可能会这样),会避免这个错误,从而实现预测,但是当解耦了之后,就会存在上述说的一些问题,以及上面的报错。

上面的报错解决方法是:

# 添加内容:
config.gpu_options.allow_growth = True
# 最后代码类似这样的:

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.per_process_gpu_memory_fraction = 0.4
session = tf.Session(config=config)
with session.as_default():
x1, x2, model_name = AnalysisData().analysis_config_json()
model = load_model(model_name)
a = model.predict((np.random.random((1, 32, 32, 3)) * 255).astype(np.int8))

  

这样即解决了我上述的报错问题。

Error : Failed to get convolution algorithm. This is probably because cuDNN failed to initialize的更多相关文章

  1. 出现Failed to get convolution algorithm的解决方法

    当运行卷积神经时出现了问题:Failed to get convolution algorithm. This is probably because cuDNN failed to initiali ...

  2. Failed to get convolution algorithm解决

    蒸腾了两天,终于搞定了 是cudnn版本的问题 更新cudnn的时候,首先要删除/usr/local/cuda-10.0/targets/x86_64-linux/lib路径下所有之前cudnn版本的 ...

  3. The main method caused an error: java.util.concurrent.ExecutionException: org.apache.flink.runtime.client.JobSubmissionException: Failed to submit JobGraph.

    在使用flink run命令提交任务可能会遇到如下错误: The program finished with the following exception: org.apache.flink.cli ...

  4. Failed to connect to VMware Lookup Service……SSL certificate verification failed

    今天登陆vsphere web-client时候,报错如下: Failed to connect to VMware Lookup Service https://vc-test.cebbank.co ...

  5. ionic 打包 报错Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt

    在platform --> android目录下找到build.gradle文件,打开并在def promptForReleaseKeyPassword() {...}函数前加入以下内容: 完整 ...

  6. error: invalid abbreviation code [25] for DIE at 0x0000003e in Assertion failed: (*offset_ptr == end_prologue_offset), function ParsePrologue, file /S

    error: invalid abbreviation code [25] for DIE at 0x0000003e in '/Users/mac/Desktop/MYiosfiles/test/X ...

  7. lr场景异常Continuing after Error -26479: Conversion of form submission data to the target charset failed: U_TRUNCATED_CHAR_FOUND解决方法

    在lr压测场景中执行,发现 一个事务都没有成功,很是奇怪,发现用linux的agent各种问题 查看lr运行日志 看到这里基本确定是编码的问题,然后想起lr设置编码的地方就那么几个,所以逐个尝试 改完 ...

  8. spring cloud gateway 启动报错,Failed to bind on [0.0.0.0:xxx] bind(..) failed: 权限不够

    最近把操作系统迁移到了deepin,不得不说Linux中需要学习的还是有很多的,本地启动网关的时候就遇到一个坑,特此记录一下,报错信息. Caused by: reactor.netty.Channe ...

  9. 项目报错 exception 'MongoConnectionException' with message 'Failed to connect to: 127.0.0.1:27017: Authentication failed on database 'www' with username 'www': auth failed' in

    出现这个错误,在官方文档也找到了解释,原来在2.6版本做了很大的改进,其改进涉及到核心.存储.网络.查询和安全性等多方面,自然,其用户登录认证机制也发生了改变,db.system.users的sche ...

随机推荐

  1. java通过jdbc插入中文到mysql显示乱码(问号或者乱码)

    对于很多初学者来说,中文字符编码不相同的问题,是一个很烦躁的问题!! 因为很多时候,我们并不知道,到底是哪一层出现了问题? 在这里稍微做个总结~也怕自己今后忘了!! 其实也就三层: 1.前端页面 2. ...

  2. 推荐几款开源的js日期控件

    做为一个正规的网站,经常需要一些日期或时间的筛选,所以我们今天就推荐二十多款javascript的js日期/时间筛选插件.个个经典,绝对有你需要的. My97DatePicker ,国人开发的一款js ...

  3. Python的初级语法

    输入输出 输出用print(),print(s0,s1,-,sN) 输入用input() 字符串 字符串用"或者""来表示,len()可以计算字符串的长度 字符串与整数的 ...

  4. 整数拆分-dp问题

    Integer Partition In number theory and combinatorics, a partition of a positive integer n, also call ...

  5. 使用apktool反编译apk文件

    Apktool https://ibotpeaches.github.io/Apktool/install/ 下载地址:Apktool https://bitbucket.org/iBotPeache ...

  6. tomcat启动后access error[730048]的解决方法

    安装了JDK... 配置了系统变量... 解压了tomcat... 配置了系统变量... 点击startup.bat启动了以后,打开浏览器,出现access error 404错误. 仔细看过控制台输 ...

  7. iOS 9,为前端世界都带来了些什么?「译」 - 高棋的博客

    2015 年 9 月,Apple 重磅发布了全新的 iPhone 6s/6s Plus.iPad Pro 与全新的操作系统 watchOS 2 与 tvOS 9(是的,这货居然是第 9 版),加上已经 ...

  8. Hi3518_SDK

    第一章 Hi3518_SDK_Vx.x.x.x版本升级操作说明 如果您是首次安装本SDK,请直接参看第2章. 第二章 首次安装SDK 1.Hi3518 SDK包位置 在"Hi3518_V10 ...

  9. pymongo bugfix后记

    有网友反馈py-mongo-sync同步异常,检查发现curosr[0]取查询结果第一个文档时报错"no such item for Cursor instance". 这里的逻辑 ...

  10. java里面的设计模式

    文章目录 Creational(创建模式) 1. Abstract factory: 2. Builder: 3. Factory: 4. Prototype: 5. Singleton: 6. Ch ...