当前位置:网站首页>Tensorflow steps on the pit notes and records various errors and solutions
Tensorflow steps on the pit notes and records various errors and solutions
2022-08-05 05:38:00 【takedachia】
I don't know if it's an illusion, tensorflow is easier to report errors than pytorch, so record the pit you stepped on.
Update from time to time.
Article table of contents
0 When an error occurs, first replace the Jupyter notebook code with a .py file and run it directly
When there is an inexplicable error, if you are currently using Jupyter notebook, first replace it with a .py file and run it directly.
Especially the gpu version of tensorflow is prone to problems under Jupyter.
1 Loaded runtime CuDNN library: 7.4.1 but source was compiled with: 7.6.0
Initial environment: tensorflow2.0 (gpu), CUDA 10.0, Cudnn 7.4.1, Windows 10
Error training convolutional neural network (when using Conv2d class):
Loaded runtime CuDNN library: 7.4.1 but source was compiled with: 7.6.0.
However, the environmental requirements of official website of tensorflow2.0 (gpu) write CUDA 10.0, Cudnn 7.4, the misleading effect is obvious.
The error report directly prompts the solution, just upgrade Cudnn to 7.6.0, the upgrade method is the same as the installation method of Cudnn, go to Official websiteDownload the corresponding Cudnn version and overwrite the source file.Also refer to the references below.
2 Custom models cannot be saved
Environment: tensorflow2.0 (gpu), CUDA 10.0, Cudnn 7.6.0, Windows 10
Using tf.keras.models.save_model(model, 'path') to save model error:
ValueError: Model
cannot be saved because the input shapes have not been set. Usually, input shapes are automatically determined from calling .fit() or .predict(). To manually set the shapes, call model._set_inputs(inputs).
References:
1.stackoverflow
2.Github: Model cannot be saved because the input shapes havenot been set. #39906
My solution:
After model initialization, after specifying input_shape in build(), write model.compute_output_shape(input_shape=(None, 32, 32, 3))That's it.
Ready to save:
边栏推荐
- 【MySQL】数据库多表链接的查询方式
- 【Over 16】Looking back at July
- 【Pytorch学习笔记】10.如何快速创建一个自己的Dataset数据集对象(继承Dataset类并重写对应方法)
- CAP+BASE
- 基于Flink CDC实现实时数据采集(一)-接口设计
- 实现跨域的几种方式
- flink中文文档-目录v1.4
- Flink Table API 和 SQL之概述
- [Redis] Resid的删除策略
- A deep learning code base for Xiaobai, one line of code implements 30+ attention mechanisms.
猜你喜欢

el-pagination左右箭头替换成文字上一页和下一页

It turns out that the MAE proposed by He Yuming is still a kind of data enhancement

拿出接口数组对象中的所有name值,取出同一个值

【NFT开发】设计师无技术基础保姆级开发NFT教程在Opensea上全套开发一个NFT项目+构建Web3网站

6k+ star,面向小白的深度学习代码库!一行代码实现所有Attention机制!

【Pytorch学习笔记】11.取Dataset的子集、给Dataset打乱顺序的方法(使用Subset、random_split)

Flink HA安装配置实战

flink实例开发-详细使用指南

Kubernetes常备技能

IDEA 配置连接数据库报错 Server returns invalid timezone. Need to set ‘serverTimezone‘ property.
随机推荐
大型Web网站高并发架构方案
机器学习(一) —— 机器学习基础
CVPR 2022 |节省70%的显存,训练速度提高2倍
如何停止flink job
【Over 15】A week of learning lstm
盘点关于发顶会顶刊论文,你需要知道写作上的这些事情!
SSL 证书签发详细攻略
Distributed and Clustered
学习总结week2_2
基于Flink CDC实现实时数据采集(一)-接口设计
[After a 12] No record for a whole week
Flutter 3.0升级内容,该如何与小程序结合
BroadCast Receiver(广播)详解
全尺度表示的上下文非局部对齐
SharedPreferences和SQlite数据库
[Redis] Resid的删除策略
11%的参数就能优于Swin,微软提出快速预训练蒸馏方法TinyViT
基于Flink CDC实现实时数据采集(四)-Sink接口实现
Machine Learning (1) - Machine Learning Fundamentals
AWS 常用服务