You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A note on Slim & contrib.layers
A large amount of older TensorFlow 1.x code uses the Slim library, which was packaged with TensorFlow 1.x as tf.contrib.layers. As a contrib module, this is no longer available in TensorFlow 2.0, even in tf.compat.v1. Converting code using Slim to TF 2.0 is more involved than converting repositories that use v1.layers. In fact, it may make sense to convert your Slim code to v1.layers first, then convert to Keras.
Remove arg_scopes, all args need to be explicit
If you use them, split normalizer_fn and activation_fn into their own layers
Separable conv layers map to one or more different Keras layers (depthwise, pointwise, and separable Keras layers)
Slim and v1.layers have different arg names & default values
Some args have different scales
If you use Slim pre-trained models, try out Keras's pre-traimed models from tf.keras.applications or TF Hub's TF2 SavedModels exported from the original Slim code.
Some tf.contrib layers might not have been moved to core TensorFlow but have instead been moved to the TF add-ons package.
The text was updated successfully, but these errors were encountered:
tensorflow 2.0
slim = tf.contrib.slim
module 'tensorflow' has no attribute 'contrib'
https://www.tensorflow.org/guide/migrate
A note on Slim & contrib.layers
A large amount of older TensorFlow 1.x code uses the Slim library, which was packaged with TensorFlow 1.x as tf.contrib.layers. As a contrib module, this is no longer available in TensorFlow 2.0, even in tf.compat.v1. Converting code using Slim to TF 2.0 is more involved than converting repositories that use v1.layers. In fact, it may make sense to convert your Slim code to v1.layers first, then convert to Keras.
Remove arg_scopes, all args need to be explicit
If you use them, split normalizer_fn and activation_fn into their own layers
Separable conv layers map to one or more different Keras layers (depthwise, pointwise, and separable Keras layers)
Slim and v1.layers have different arg names & default values
Some args have different scales
If you use Slim pre-trained models, try out Keras's pre-traimed models from tf.keras.applications or TF Hub's TF2 SavedModels exported from the original Slim code.
Some tf.contrib layers might not have been moved to core TensorFlow but have instead been moved to the TF add-ons package.
The text was updated successfully, but these errors were encountered: