Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with tensorflow 2.0 #3

Closed
peterdn1 opened this issue Nov 13, 2019 · 1 comment
Closed

Does not work with tensorflow 2.0 #3

peterdn1 opened this issue Nov 13, 2019 · 1 comment

Comments

@peterdn1
Copy link

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.

@peace195
Copy link
Owner

@peterdn1 Please try it on tensorflow 1.13.1 or 1.14.0. I have not tried with tensorflow 2.0

It is great if you develop a branch for tensorflow 2.0 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants