问题描述
tensorflow1.0版本中的
tf.contrib.layers.xavier_initializer()
可以替换为tensorflow2.0版本中的
tf.keras.initializers.glorot_normal
(Xavier and Glorot are 2 names for the same initializer algorithm)
编译器相关算法完全相同
if dtype is important for some compatibility reasons - use
如果有兼容性的问题请参考
tf.compat.v1.keras.initializers.glorot_normal
原文链接:
python - change tf.contrib.layers.xavier_initializer() to 2.0.0 - Stack Overflow
这篇博客介绍了如何将 TensorFlow 1.0 版本中的 `tf.contrib.layers.xavier_initializer()` 迁移到 TensorFlow 2.0,指出可以使用 `tf.keras.initializers.glorot_normal` 作为替代,因为 Xavier 和 Glorot 是同一初始化算法的两种称呼。文章提醒,如果存在兼容性问题,可以使用 `tf.compat.v1.keras.initializers.glorot_normal`。这是一个关于 TensorFlow 版本升级和初始化器转换的主题。
939





