Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Reduce usage of tf.contrib #1345

Merged
merged 9 commits into from
Jan 7, 2019
Merged

Conversation

lgeiger
Copy link
Contributor

@lgeiger lgeiger commented Jan 6, 2019

tensor2tensor uses many deprecated functions from tf.contrib.
This PR replaces the use of tf.contrib with stable tensorflow functionality.

tf.contrib.framework.load_checkpoint -> tf.train.load_checkpoint
tf.contrib.framework.list_variables -> tf.train.list_variables
tf.contrib.framework.init_from_checkpoint -> tf.train.init_from_checkpoint
tf.contrib.learn.ModeKeys.TRAIN -> tf.estimator.ModeKeys.TRAIN
tf.contrib.learn.ModeKeys.EVAL -> tf.estimator.ModeKeys.EVAL
tf.contrib.learn.ModeKeys.INFER -> tf.estimator.ModeKeys.PREDICT
@googlebot googlebot added the cla: yes PR author has signed CLA label Jan 6, 2019
@afrozenator
Copy link
Contributor

This is really awesome, thanks again @lgeiger !

@afrozenator afrozenator merged commit 4c7e7ef into tensorflow:master Jan 7, 2019
tensorflow-copybara pushed a commit that referenced this pull request Jan 7, 2019
PiperOrigin-RevId: 228228161
@lgeiger lgeiger deleted the replace-tf-contrib branch January 7, 2019 21:47
kpe pushed a commit to kpe/tensor2tensor that referenced this pull request Mar 2, 2019
* tf.contrib.rnn -> tf.nn.rnn_cell

* tf.contrib.framework -> tf.train

tf.contrib.framework.load_checkpoint -> tf.train.load_checkpoint
tf.contrib.framework.list_variables -> tf.train.list_variables
tf.contrib.framework.init_from_checkpoint -> tf.train.init_from_checkpoint

* tf.contrib.learn.ModeKeys -> tf.estimator.ModeKeys

tf.contrib.learn.ModeKeys.TRAIN -> tf.estimator.ModeKeys.TRAIN
tf.contrib.learn.ModeKeys.EVAL -> tf.estimator.ModeKeys.EVAL
tf.contrib.learn.ModeKeys.INFER -> tf.estimator.ModeKeys.PREDICT

* tf.contrib.eager.in_eager_mode -> tf.executing_eagerly

* tf.contrib.data.batch_and_drop_remainder -> .batch(..., drop_remainder=True)

* tf.contrib.data -> tf.data.experimental

* tf.contrib.util.make_tensor_proto -> tf.make_tensor_proto

* Simplify tf.contrib.eager imports

* tf.initialize_all_variables -> tf.global_variables_initializer
kpe pushed a commit to kpe/tensor2tensor that referenced this pull request Mar 2, 2019
PiperOrigin-RevId: 228228161
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants