当前位置:网站首页>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:
边栏推荐
- Lecture 3 Gradient Tutorial Gradient Descent and Stochastic Gradient Descent
- MaskDistill-不需要标注数据的语义分割
- 【NFT开发】设计师无技术基础保姆级开发NFT教程在Opensea上全套开发一个NFT项目+构建Web3网站
- 【数据库和SQL学习笔记】3.数据操纵语言(DML)、SELECT查询初阶用法
- 盘点关于发顶会顶刊论文,你需要知道写作上的这些事情!
- 门徒Disciples体系:致力于成为“DAO世界”中的集大成者。
- 对数据排序
- CVPR最佳论文得主清华黄高团队提出首篇动态网络综述
- SQL(1) - Add, delete, modify and search
- AWS 常用服务
猜你喜欢

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

【数据库和SQL学习笔记】8.SQL中的视图(view)

flink中文文档-目录v1.4

The difference between the operators and logical operators

Thread handler handle IntentServvice handlerThread

【数据库和SQL学习笔记】7.SQL中的插入(INSERT)、删除(DELETE)、更新(UPDATE)

CVPR 2022 |节省70%的显存,训练速度提高2倍

【MySQL】数据库多表链接的查询方式
![[Pytorch study notes] 9. How to evaluate the classification results of the classifier - using confusion matrix, F1-score, ROC curve, PR curve, etc. (taking Softmax binary classification as an example)](/img/ac/884d8aba8b9d363e3b9ae6de33d5a4.png)
[Pytorch study notes] 9. How to evaluate the classification results of the classifier - using confusion matrix, F1-score, ROC curve, PR curve, etc. (taking Softmax binary classification as an example)

服务网格istio 1.12.x安装
随机推荐
如何编写一个优雅的Shell脚本(三)
全尺度表示的上下文非局部对齐
鼠标放上去变成销售效果
大型Web网站高并发架构方案
BFC详解(Block Formmating Context)
[Go through 10] sklearn usage record
周末作业-循环练习题(2)
Flink Distributed Cache 分布式缓存
Day1:用原生JS把你的设备变成一台架子鼓!
Machine Learning (1) - Machine Learning Fundamentals
BroadCast Receiver(广播)详解
机器学习(一) —— 机器学习基础
【数据库和SQL学习笔记】9.(T-SQL语言)定义变量、高级查询、流程控制(条件、循环等)
数据库期末考试,选择、判断、填空题汇总
SSL 证书签发详细攻略
【数据库和SQL学习笔记】4.SELECT查询2:排序(ORDER BY)、聚合函数、分组查询(GROUP BY)
【Reading】Long-term update
【数据库和SQL学习笔记】7.SQL中的插入(INSERT)、删除(DELETE)、更新(UPDATE)
SharedPreferences和SQlite数据库
学习总结week2_1