Tensorflow Keras官方教程中的折旧警告

瓦伦塔斯

示例代码

model = tf.keras.Sequential()
# Adds a densely-connected layer with 64 units to the model:
model.add(layers.Dense(64, activation='relu'))
# Add another:
model.add(layers.Dense(64, activation='relu'))
# Add a softmax layer with 10 output units:
model.add(layers.Dense(10, activation='softmax'))

Tensorflow官方网站上的结果会在该页面本身中显示警告。

calling VarianceScaling.__init__ (from tensorflow.python.ops.init_ops) with dtype is deprecated and will be removed in a future version.

警告的原因是什么?应如何更改代码以避免此类警告?

优生学

欢迎加入俱乐部:)我的意思是,tensorflow因无法向后兼容而臭名昭著,更糟糕的是,很长一段时间以来都出现了这样的警告。

看到这里:https : //github.com/tensorflow/tensorflow/issues/25996

因此,最好的选择就是忽略这些警告,并且,如果您希望主动,那就做出一些贡献。否则,请确保它们不会使您分心于主要任务。现在警告在张量流中是正常的。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章