python - 加载 keras 模型时产生的警告

标签 python tensorflow machine-learning keras

当调用 rnn_model = keras.models.load_model('bin/rnn') 在训练模型并使用 model.save('bin/rnn')

保存之后

它在控制台中产生了大量我无法解释的警告:

2021-01-08 23:32:12.052179: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:12.072767: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:12.534962: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:13.515182: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:13.678562: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:13.707091: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:13.936798: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:14.196727: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:15.554499: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:15.581370: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:15.665304: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:15.689471: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:15.899045: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:16.416461: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:16.439738: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:16.598053: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:16.627368: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:18.063784: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:18.082790: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:18.869241: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:18.894552: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.063483: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.540079: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.569451: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.618969: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.649699: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.753987: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond/while' has 13 outputs but the _output_shapes attribute specifies shapes for 44 outputs. Output shapes may be inaccurate.
2021-01-08 23:32:20.777206: W tensorflow/core/common_runtime/graph_constructor.cc:809] Node 'cond' has 5 outputs but the _output_shapes attribute specifies shapes for 45 outputs. Output shapes may be inaccurate.

它们是什么意思,我应该如何处理它们/阻止它们发生?

最佳答案

您可以尝试添加经常性辍学。当我遇到这个问题时,它似乎对我有用。我怀疑这与 CudNN 优化架构的实现略有不同有关。

关于python - 加载 keras 模型时产生的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65637396/

相关文章:

python - 使用 App Engine Google Cloud 部署 TensorFlow 应用程序时出错

machine-learning - 在 Siamese 网络中使用 AlexNet 代替 LeNet 模型

machine-learning - 如何使用线性感知器中的权重向量画一条线?

r - 如何在 Caret 包中为 kNN 模型创建决策边界图?

Python "Hangman"代码

python - 将配置数据文本与默认数据文本进行比较

machine-learning - Tensorflow 多元线性回归结果为 NaN

python - 不减少尺寸的 Tensorflow 序列掩码

python - 加载 3 列 csv 作为连音列表

python - 调用修饰的外部函数