记录一下:

报错:# 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. 各大厂RTSP取流的URI

    目前使用过的各大厂商取流规则是在实际的工作中遇到的相关视频接入问题,通过rtsp协议接入视频数据的一些记录,其中的图片可能来源于网络,内容部分来源于网络,本人仅仅是对相关内容作了汇总. 海康RTSP取 ...

  2. git相关学习地址

    https://git-scm.com/book/zh/v2    这篇文章写得不错,值得一读

  3. jQuery实现button按钮提交表单

    在JSP页面中,通常使用button按钮提交表单数据,使用jQuery实现代码如下: <span style="font-family:Comic Sans MS;font-size: ...

  4. laravel如何输出最后一条执行的SQL

    \DB::connection()->enableQueryLog(); // 开启查询日志 \DB::table('xxx'); // 要查看的sql $queries = \DB::getQ ...

  5. 吴裕雄--天生自然 R语言开发学习:基础知识

    1.基础数据结构 1.1 向量 # 创建向量a a <- c(1,2,3) print(a) 1.2 矩阵 #创建矩阵 mymat <- matrix(c(1:10), nrow=2, n ...

  6. vue element 全屏不好用问题

    Chrome71版本使用screenfull.js全屏功能时报参数错误   在生产环境长期使用的一个“全屏”功能突然失效了,查看Console 如下报错: Failed to execute 'req ...

  7. vscode中的live-server配置https?

    json文件中使用绝对路径添加证书 "liveServer.settings.https": { "enable": true, "cert" ...

  8. [LC] 66. Plus One

    Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The ...

  9. Python:扫描目录下的所有文件

    扫描目录下的所有文件并返回文件的绝对路径 def fileListFunc(filePathList): fileList = [] for filePath in filePathList: for ...

  10. 利用.swp文件恢复源文件

    使用命令 vim -r filename.swp 保存即可