Error : Failed to get convolution algorithm. This is probably because cuDNN failed to initialize
记录一下:
报错:# 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的更多相关文章
- 出现Failed to get convolution algorithm的解决方法
当运行卷积神经时出现了问题:Failed to get convolution algorithm. This is probably because cuDNN failed to initiali ...
- Failed to get convolution algorithm解决
蒸腾了两天,终于搞定了 是cudnn版本的问题 更新cudnn的时候,首先要删除/usr/local/cuda-10.0/targets/x86_64-linux/lib路径下所有之前cudnn版本的 ...
- 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 ...
- 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 ...
- ionic 打包 报错Execution failed for task ':processDebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt
在platform --> android目录下找到build.gradle文件,打开并在def promptForReleaseKeyPassword() {...}函数前加入以下内容: 完整 ...
- 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 ...
- lr场景异常Continuing after Error -26479: Conversion of form submission data to the target charset failed: U_TRUNCATED_CHAR_FOUND解决方法
在lr压测场景中执行,发现 一个事务都没有成功,很是奇怪,发现用linux的agent各种问题 查看lr运行日志 看到这里基本确定是编码的问题,然后想起lr设置编码的地方就那么几个,所以逐个尝试 改完 ...
- spring cloud gateway 启动报错,Failed to bind on [0.0.0.0:xxx] bind(..) failed: 权限不够
最近把操作系统迁移到了deepin,不得不说Linux中需要学习的还是有很多的,本地启动网关的时候就遇到一个坑,特此记录一下,报错信息. Caused by: reactor.netty.Channe ...
- 项目报错 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 ...
随机推荐
- ExecutorCompletionService理解记忆
java.util.concurrent 类 ExecutorCompletionService<V> java.lang.Object 继承者 java.util.concurren ...
- Nearby Bicycles
With fast developments of information and communication technology, many cities today have establish ...
- [LC] 58. Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...
- [LC] 437. Path Sum III
You are given a binary tree in which each node contains an integer value. Find the number of paths t ...
- 前端-js-长期维护
############### JS简介和JS引入 ################ <!DOCTYPE html> <html lang="en" ...
- Jeninks远程部署war包
主体上看别人的脚本,然后和开发协商,做出符合自己的生产脚本................................ 脚本一: #!/bin/bash DATE=`date +%F-%H-%M` ...
- springboot 配置热部署 及 热部署后依旧是404的坑
springboot配置热部署的教程网上一大堆: 个人喜欢这种方式: https://www.cnblogs.com/winner-0715/p/6666579.html 本文主要强调的是,大家如果配 ...
- 关于前端使用JavaScript获取base64图片大小的方法
base64原理 Base64编码要求把3个8位字节(38=24)转化为4个6位的字节(46=24),之后在6位的前面补两个0,形成8位一个字节的形式. 如果剩下的字符不足3个字节,则用0填充,输出字 ...
- CF580D_Kefa and Dishes
D. Kefa and Dishes time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Vue源码之组件化/生命周期(个人向)
大致流程 具体流程 组件化 (createComponent) 构造⼦类构造函数 const baseCtor = context.$options._base // plain options ob ...