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

TensorFlow 1 & 2 Support #93

Closed
ushmalramesh opened this issue Apr 8, 2019 · 5 comments
Closed

TensorFlow 1 & 2 Support #93

ushmalramesh opened this issue Apr 8, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ushmalramesh
Copy link

Currently importing adanet with tensorflow 2.0.0alpha gives the error 'ModuleNotFoundError: No module named 'tensorflow.contrib''

Are there plans to extend compatibility to the new TF API?

@cweill
Copy link
Contributor

cweill commented Apr 8, 2019

@ushmalramesh: As you saw, we only support TF 1.9 to 1.13, but not TF 2.0.

We'll be adding TF 2.0 support slowly but surely over the next few months, but don't expect full TF 2.0 until end-of-summer '19 and once TF 2.0 is out of pre-release.

@cweill cweill added help wanted Extra attention is needed enhancement New feature or request labels Apr 8, 2019
@cweill cweill pinned this issue Apr 8, 2019
@cweill cweill self-assigned this Apr 18, 2019
cweill added a commit that referenced this issue Apr 22, 2019
Add support to `adanet.ensemble` package.

Create `adanet.tf_compat` package for migration utilities.

PiperOrigin-RevId: 244197093
cweill added a commit that referenced this issue Apr 22, 2019
Refs #93.
* Allow failures.
Copybara import of the project:

  - 46bd7ee Add TF 2.0 with allow_failuers by Charles Weill <weill@google.com>
  - f9212fd Allow_failures by Charles Weill <weill@google.com>
  - 9244ad5 try by Charles Weill <weill@google.com>
  - afe4bb7 Try another allow_failure scheme by Charles Weill <weill@google.com>
  - f2323ae all by Charles Weill <weill@google.com>
  - bfb00e5 Merge f2323ae into 973eb... by Charles Weill <c@weill.io>

PiperOrigin-RevId: 244424209
@cweill cweill changed the title Compatibility with tensorflow 2.0.0 Compatibility with TensorFlow 2.0.0 Apr 23, 2019
cweill added a commit that referenced this issue Apr 25, 2019
* Handle import errors so that tests can run with TF 2.0 (i.e. missing tf.contrib).
* Get most eval metric tests to pass.
* Add TensorFlow version shims to `adanet.tf_compat`.
* Replace `tf.app.run()` with `absl.app.run(main)`.

TravisCI build: https://travis-ci.org/tensorflow/adanet/builds/523773601

Refs #93.

Copybara import of the project:

  - 4b76c18 run script by Charles Weill <weill@google.com>
  - 781f8ce Three failing tests left by Charles Weill <weill@google.com>
  - 9197bde Some eval metrics test pass by Charles Weill <weill@google.com>
  - a3e3600 Fix metric by Charles Weill <weill@google.com>
  - 28015bd fix imports by Charles Weill <weill@google.com>
  - 2668785 Fix import error by Charles Weill <weill@google.com>
  - e333310 Fix compatibility. by Charles Weill <weill@google.com>
  - 9c28429 More compat fixes by Charles Weill <weill@google.com>
  - 23afd77 SessionRunHook by Charles Weill <weill@google.com>
  - 399b7be Fix build by Charles Weill <weill@google.com>
  - c3fe573 More fixes by Charles Weill <weill@google.com>
  - 540456a And more fixes by Charles Weill <weill@google.com>
  - 1c7fd74 Summaries by Charles Weill <weill@google.com>
  - fbc144e Replace absl app by Charles Weill <weill@google.com>
  - abf9563 Merge fbc144e into 20986... by Charles Weill <c@weill.io>

PiperOrigin-RevId: 245145934
cweill added a commit that referenced this issue Apr 25, 2019
PiperOrigin-RevId: 245298663
cweill added a commit that referenced this issue Apr 30, 2019
* core/estimator
* core/iteration
* core/ensemble_builder
* core/candidate

PiperOrigin-RevId: 245937879
cweill added a commit that referenced this issue May 2, 2019
@cweill cweill mentioned this issue May 3, 2019
7 tasks
cweill added a commit that referenced this issue May 4, 2019
* Drop support for TF < 1.13
* Convert files to TF 2.0 compatible code:
   * `adanet.distributed` package.
   * Report materializer and accessor.
   * Distributed tests and runner.
* Update tf.losses.* to be tf_compat.v2.losses.*.
* Allow distributed tests to execute runner without building binary with Bazel.
* Fix issue with missing DatasetV1 import.
* Add TF 2.0 nightly build to CI.

PiperOrigin-RevId: 246631380
cweill added a commit that referenced this issue Aug 2, 2019
Provides equivalent support as tf.estimator.Estimator.

Required for TensorFlow 2.0 migration #93.

PiperOrigin-RevId: 261331779
cweill added a commit that referenced this issue Aug 15, 2019
PiperOrigin-RevId: 263651488
cweill added a commit that referenced this issue Aug 16, 2019
cweill added a commit that referenced this issue Sep 18, 2019
Fallback to old TF v1 versions of summaries when TF v2 behavior is not enabled.

Also add additional summary, estimator, and autoensemble tests that only execute when TF v2 is enabled.

PiperOrigin-RevId: 269815407
@cweill cweill mentioned this issue Sep 18, 2019
5 tasks
@cweill cweill changed the title Compatibility with TensorFlow 2.0.0 TensorFlow 1 & 2 Support Sep 18, 2019
cweill added a commit that referenced this issue Sep 23, 2019
 * Mostly fixes tests to run in Graph mode.
 * Update TPU to work in both TF 1 and 2.

Refs #93
Copybara import of the project:

  - eab409c Fix summary tests in TF 1. by Charles Weill <weill@google.com>
  - ae8333e Fix autoensemblev2 test by Charles Weill <weill@google.com>
  - 98f1812 Fix summaries for TF 2. by Charles Weill <weill@google.com>
  - f1038ca Skip tests on TPU since it's unsupported. by Charles Weill <weill@google.com>
  - 43820a4 Get eval_metrics to pass. by Charles Weill <weill@google.com>
  - 7ea15ef Skip autoensemble estimator v1 tests. by Charles Weill <weill@google.com>
  - 2c5d8fd Fix test wrapper. by Charles Weill <weill@google.com>
  - 516b5ce Fix hashable var key. by Charles Weill <weill@google.com>
  - 5a4d6c9 Fix evaluator tests. by Charles Weill <weill@google.com>
  - 2a3cd97 Skip autoensemble V2 test in TF 1. by Charles Weill <weill@google.com>
  - 4979989 Update travis to TF 2.0.rc1 by Charles Weill <weill@google.com>
  - 8521e4d Fix checkpointsaver test by Charles Weill <weill@google.com>
  - 24f3cab Skip summary tests on 2.0 not 1.0 by Charles Weill <weill@google.com>
  - 7701dde Fix report materializer tests. by Charles Weill <weill@google.com>
  - 9d76606 Fix ensemble tests by Charles Weill <weill@google.com>
  - f0bc643 Fix simple_dnn for TF 2.0 by Charles Weill <weill@google.com>
  - 269a406 Fix report tests. by Charles Weill <weill@google.com>
  - 4e49cc8 Handle missing contrib import by Charles Weill <weill@google.com>
  - e38d479 Fix TPU for TF 2. by Charles Weill <weill@google.com>
  - 545fb54 Merge branch 'master' into feature/tf_1_2_compat by Charles Weill <weill@google.com>
  - dc35bcf Merge 545fb54 into 55e06... by Charles Weill <c@weill.io>

PiperOrigin-RevId: 270749730
cweill added a commit that referenced this issue Sep 30, 2019
* Nightly builds may still fail.

Copybara import of the project:

  - dd76348 Fix remaining nightly failures. by Charles Weill <weill@google.com>
  - 7419ed7 Skip contrib failures. by Charles Weill <weill@google.com>
  - 1256e18 Allow nightly-failures. by Charles Weill <weill@google.com>
  - 5501ebc Use TF 2.0.0-rc2 by Charles Weill <weill@google.com>
  - 5021681 Remove ModuleNotFoundError. by Charles Weill <weill@google.com>
  - 2638774 Merge 5021681 into 97a3c... by Charles Weill <c@weill.io>

PiperOrigin-RevId: 272028200
@cweill cweill closed this as completed Oct 2, 2019
@cweill cweill unpinned this issue Oct 2, 2019
@cweill
Copy link
Contributor

cweill commented Oct 2, 2019

Fixed in adanet==0.8.0 release.

@lc0
Copy link
Contributor

lc0 commented Oct 3, 2019

@cweill does it mean, that now we can test adanet with tf2?

@shendiaomo
Copy link

@cweill does it mean, that now we can test adanet with tf2?

I don't think so because it seems that adanet.Estimator still depends on contrib.Head,

@cweill
Copy link
Contributor

cweill commented Oct 16, 2019

@lc0 Yes, you should now be able to test adanet==0.8.0 with TF2.

@shendiaomo: AdaNet currently supports the new estimator heads, such as tf.estimator.RegressionHead() and tf.estimator.BinaryClassHead().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants