当前位置:网站首页>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:
边栏推荐
- SharedPreferences和SQlite数据库
- 【Pytorch学习笔记】8.训练类别不均衡数据时,如何使用WeightedRandomSampler(权重采样器)
- redis cache clearing strategy
- Thread handler handle IntentServvice handlerThread
- MSRA提出学习实例和分布式视觉表示的极端掩蔽模型ExtreMA
- 怎样在Disciples门徒获得收益?
- SQL(1) - Add, delete, modify and search
- BroadCast Receiver(广播)详解
- flink yarn-session的两种使用方式
- spingboot 容器项目完成CICD部署
猜你喜欢
随机推荐
Distributed and Clustered
Calling Matlab configuration in pycharm: No module named 'matlab.engine'; 'matlab' is not a package
Matplotlib(二)—— 子图
学习总结week2_5
门徒Disciples体系:致力于成为“DAO世界”中的集大成者。
关于基于若依框架的路由跳转
【数据库和SQL学习笔记】6.SELECT查询4:嵌套查询、对查询结果进行操作
数据库期末考试,选择、判断、填空题汇总
Kubernetes常备技能
flink实例开发-batch批处理实例
Flink Broadcast 广播变量
AWS 常用服务
Lecture 3 Gradient Tutorial Gradient Descent and Stochastic Gradient Descent
It turns out that the MAE proposed by He Yuming is still a kind of data enhancement
【数据库和SQL学习笔记】8.SQL中的视图(view)
轻松接入Azure AD+Oauth2 实现 SSO
Flink HA安装配置实战
Flink Distributed Cache 分布式缓存
day11-函数作业
flink on yarn 集群模式启动报错及解决方案汇总




![[Go through 9] Convolution](/img/84/e6d99793aacf10a7b099f60bcaf290.png)




