How can I change tf.contrib.layers.xavier_initializer_conv2d
to 2.0.0 so that I can use it in the context of tensorflow-2.0.0.
Thank you!
How can I change tf.contrib.layers.xavier_initializer_conv2d
to 2.0.0 so that I can use it in the context of tensorflow-2.0.0.
Thank you!
You can use Glorot normal initializer, also called Xavier normal initializer in TF 2.x
in place of xavier_initializer_conv2d()
.
tf.keras.initializers.GlorotNormal(
seed=None
)
Also, tf.contrib.layers
is deprecated in TF 2.x
and replaced with TF slim.
This migration guide might be helpful for you to convert TF 1.x
code to TF 2.x
.