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

Update tensorflow requirement from !=2.6.0,!=2.6.1,<2.10.0,>=2.2.0 to >=2.2.0,!=2.6.0,!=2.6.1,<2.11.0 #608

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 7, 2022

Updates the requirements on tensorflow to permit the latest version.

Release notes

Sourced from tensorflow's releases.

TensorFlow 2.10.0

Release 2.10.0

Breaking Changes

  • Causal attention in keras.layers.Attention and keras.layers.AdditiveAttention is now specified in the call() method via the use_causal_mask argument (rather than in the constructor), for consistency with other layers.
  • Some files in tensorflow/python/training have been moved to tensorflow/python/tracking and tensorflow/python/checkpoint. Please update your imports accordingly, the old files will be removed in Release 2.11.
  • tf.keras.optimizers.experimental.Optimizer will graduate in Release 2.11, which means tf.keras.optimizers.Optimizer will be an alias of tf.keras.optimizers.experimental.Optimizer. The current tf.keras.optimizers.Optimizer will continue to be supported as tf.keras.optimizers.legacy.Optimizer, e.g.,tf.keras.optimizers.legacy.Adam. Most users won't be affected by this change, but please check the API doc if any API used in your workflow is changed or deprecated, and make adaptions. If you decide to keep using the old optimizer, please explicitly change your optimizer to tf.keras.optimizers.legacy.Optimizer.
  • RNG behavior change for tf.keras.initializers. Keras initializers will now use stateless random ops to generate random numbers.
    • Both seeded and unseeded initializers will always generate the same values every time they are called (for a given variable shape). For unseeded initializers (seed=None), a random seed will be created and assigned at initializer creation (different initializer instances get different seeds).
    • An unseeded initializer will raise a warning if it is reused (called) multiple times. This is because it would produce the same values each time, which may not be intended.

Deprecations

  • The C++ tensorflow::Code and tensorflow::Status will become aliases of respectively absl::StatusCode and absl::Status in some future release.
    • Use tensorflow::OkStatus() instead of tensorflow::Status::OK().
    • Stop constructing Status objects from tensorflow::error::Code.
    • One MUST NOT access tensorflow::errors::Code fields. Accessing tensorflow::error::Code fields is fine.
      • Use the constructors such as tensorflow::errors:InvalidArgument to create status using an error code without accessing it.
      • Use the free functions such as tensorflow::errors::IsInvalidArgument if needed.
      • In the last resort, use e.g.static_cast<tensorflow::errors::Code>(error::Code::INVALID_ARGUMENT) or static_cast<int>(code) for comparisons.
  • tensorflow::StatusOr will also become in the future alias to absl::StatusOr, so use StatusOr::value instead of StatusOr::ConsumeValueOrDie.

Major Features and Improvements

  • tf.lite:

    • New operations supported:
      • tflite SelectV2 now supports 5D.
      • tf.einsum is supported with multiple unknown shapes.
      • tf.unsortedsegmentprod op is supported.
      • tf.unsortedsegmentmax op is supported.
      • tf.unsortedsegmentsum op is supported.
    • Updates to existing operations:
      • tfl.scatter_nd now supports I1 for update arg.
    • Upgrade Flatbuffers v2.0.5 from v1.12.0
  • tf.keras:

    • EinsumDense layer is moved from experimental to core. Its import path is moved from tf.keras.layers.experimental.EinsumDense to tf.keras.layers.EinsumDense.
    • Added tf.keras.utils.audio_dataset_from_directory utility to easily generate audio classification datasets from directories of .wav files.
    • Added subset="both" support in tf.keras.utils.image_dataset_from_directory,tf.keras.utils.text_dataset_from_directory, and audio_dataset_from_directory, to be used with the validation_split argument, for returning both dataset splits at once, as a tuple.
    • Added tf.keras.utils.split_dataset utility to split a Dataset object or a list/tuple of arrays into two Dataset objects (e.g. train/test).
    • Added step granularity to BackupAndRestore callback for handling distributed training failures & restarts. The training state can now be restored at the exact epoch and step at which it was previously saved before failing.
    • Added tf.keras.dtensor.experimental.optimizers.AdamW. This optimizer is similar as the existing keras.optimizers.experimental.AdamW, and works in the DTensor training use case.
    • Improved masking support for tf.keras.layers.MultiHeadAttention.
      • Implicit masks for query, key and value inputs will automatically be used to compute a correct attention mask for the layer. These padding masks will be combined with any attention_mask passed in directly when calling the layer. This can be used with tf.keras.layers.Embedding with mask_zero=True to automatically infer a correct padding mask.
      • Added a use_causal_mask call time arugment to the layer. Passing use_causal_mask=True will compute a causal attention mask, and optionally combine it with any attention_mask passed in directly when calling the layer.

... (truncated)

Changelog

Sourced from tensorflow's changelog.

Release 2.10.0

Breaking Changes

  • Causal attention in keras.layers.Attention and keras.layers.AdditiveAttention is now specified in the call() method via the use_causal_mask argument (rather than in the constructor), for consistency with other layers.
  • Some files in tensorflow/python/training have been moved to tensorflow/python/tracking and tensorflow/python/checkpoint. Please update your imports accordingly, the old files will be removed in Release 2.11.
  • tf.keras.optimizers.experimental.Optimizer will graduate in Release 2.11, which means tf.keras.optimizers.Optimizer will be an alias of tf.keras.optimizers.experimental.Optimizer. The current tf.keras.optimizers.Optimizer will continue to be supported as tf.keras.optimizers.legacy.Optimizer, e.g.,tf.keras.optimizers.legacy.Adam. Most users won't be affected by this change, but please check the API doc if any API used in your workflow is changed or deprecated, and make adaptions. If you decide to keep using the old optimizer, please explicitly change your optimizer to tf.keras.optimizers.legacy.Optimizer.
  • RNG behavior change for tf.keras.initializers. Keras initializers will now use stateless random ops to generate random numbers.
    • Both seeded and unseeded initializers will always generate the same values every time they are called (for a given variable shape). For unseeded initializers (seed=None), a random seed will be created and assigned at initializer creation (different initializer instances get different seeds).
    • An unseeded initializer will raise a warning if it is reused (called) multiple times. This is because it would produce the same values each time, which may not be intended.

Deprecations

  • The C++ tensorflow::Code and tensorflow::Status will become aliases of respectively absl::StatusCode and absl::Status in some future release.
    • Use tensorflow::OkStatus() instead of tensorflow::Status::OK().
    • Stop constructing Status objects from tensorflow::error::Code.
    • One MUST NOT access tensorflow::errors::Code fields. Accessing tensorflow::error::Code fields is fine.
      • Use the constructors such as tensorflow::errors:InvalidArgument to create status using an error code without accessing it.
      • Use the free functions such as tensorflow::errors::IsInvalidArgument if needed.
      • In the last resort, use e.g.static_cast<tensorflow::errors::Code>(error::Code::INVALID_ARGUMENT) or static_cast<int>(code) for comparisons.
  • tensorflow::StatusOr will also become in the future alias to absl::StatusOr, so use StatusOr::value instead of StatusOr::ConsumeValueOrDie.

Major Features and Improvements

  • tf.lite:

    • New operations supported:
      • tflite SelectV2 now supports 5D.
      • tf.einsum is supported with multiple unknown shapes.
      • tf.unsortedsegmentprod op is supported.
      • tf.unsortedsegmentmax op is supported.
      • tf.unsortedsegmentsum op is supported.
    • Updates to existing operations:
      • tfl.scatter_nd now supports I1 for update arg.
    • Upgrade Flatbuffers v2.0.5 from v1.12.0
  • tf.keras:

    • EinsumDense layer is moved from experimental to core. Its import path is moved from tf.keras.layers.experimental.EinsumDense to tf.keras.layers.EinsumDense.
    • Added tf.keras.utils.audio_dataset_from_directory utility to easily generate audio classification datasets from directories of .wav files.
    • Added subset="both" support in tf.keras.utils.image_dataset_from_directory,tf.keras.utils.text_dataset_from_directory, and audio_dataset_from_directory, to be used with the validation_split argument, for returning both dataset splits at once, as a tuple.
    • Added tf.keras.utils.split_dataset utility to split a Dataset object or a list/tuple of arrays into two Dataset objects (e.g. train/test).
    • Added step granularity to BackupAndRestore callback for handling distributed training failures & restarts. The training state can now be restored at the exact epoch and step at which it was previously saved before failing.
    • Added tf.keras.dtensor.experimental.optimizers.AdamW. This optimizer is similar as the existing keras.optimizers.experimental.AdamW, and works in the DTensor training use case.
    • Improved masking support for tf.keras.layers.MultiHeadAttention.
      • Implicit masks for query, key and value inputs will automatically be used to compute a correct attention mask for the layer. These padding masks will be combined with any attention_mask passed in directly when calling the layer. This can be used with tf.keras.layers.Embedding with mask_zero=True to automatically infer a correct padding mask.
      • Added a use_causal_mask call time arugment to the layer. Passing use_causal_mask=True will compute a causal attention mask, and optionally combine it with any attention_mask passed in directly when calling the layer.
    • Added ignore_class argument in the loss SparseCategoricalCrossentropy and metrics IoU and MeanIoU, to specify a class index to be ignored during loss/metric computation (e.g. a background/void class).
    • Added tf.keras.models.experimental.SharpnessAwareMinimization. This class implements the sharpness-aware minimization technique, which boosts model performance on various tasks, e.g., ResNet on image classification.

... (truncated)

Commits
  • 359c3cd Merge pull request #57609 from tensorflow/vinila21-patch-6
  • 724308f Update estimator and keras version in TF 2.10 branch for 2.10.0.
  • 203b333 Merge pull request #57608 from tensorflow-jenkins/version-numbers-2.10.0-28960
  • cd950ff Update version numbers to 2.10.0
  • 9b13e9e Merge pull request #57510 from tensorflow/vinila21-patch-1
  • ba47bc7 Update release notes with security updates
  • f082fa9 Merge pull request #57464 from tensorflow/r2.10-b5f6fbfba76
  • 60ed7ce Re-enable testTensorListReserveWithNonScalarNumElements to work with mlir as ...
  • 23cb0d3 Merge pull request #57460 from tensorflow/revert-57075-r2.10-e9863e9a9cb
  • f419a41 Revert "r2.10 cherry-pick: e9863e9a9cb "Fix tf.raw_ops.EmptyTensorList vulner...
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Sep 7, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2022

Codecov Report

Merging #608 (b60f938) into master (df7edca) will increase coverage by 0.11%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #608      +/-   ##
==========================================
+ Coverage   77.88%   77.99%   +0.11%     
==========================================
  Files         123      123              
  Lines        8714     8749      +35     
==========================================
+ Hits         6787     6824      +37     
+ Misses       1927     1925       -2     
Flag Coverage Δ
ubuntu-latest-3.10.6 77.84% <ø> (?)
ubuntu-latest-3.7 77.78% <ø> (+0.02%) ⬆️
ubuntu-latest-3.8 77.79% <ø> (ø)
ubuntu-latest-3.9 77.79% <ø> (ø)
windows-latest-3.9 74.98% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
alibi_detect/od/vae.py 89.28% <0.00%> (-1.08%) ⬇️
alibi_detect/cd/base.py 90.93% <0.00%> (-0.22%) ⬇️
alibi_detect/utils/fetching/fetching.py 0.00% <0.00%> (ø)
alibi_detect/saving/schemas.py 99.25% <0.00%> (+0.04%) ⬆️
alibi_detect/utils/missing_optional_dependency.py 94.44% <0.00%> (+0.15%) ⬆️
alibi_detect/datasets.py 70.00% <0.00%> (+1.44%) ⬆️
alibi_detect/utils/frameworks.py 91.66% <0.00%> (+4.16%) ⬆️

@ascillitoe
Copy link
Contributor

ascillitoe commented Sep 7, 2022

Changes to investigate:

  • "tf.keras.optimizers.experimental.Optimizer will graduate in Release 2.11, which means tf.keras.optimizers.Optimizer will be an alias of tf.keras.optimizers.experimental.Optimizer. The current tf.keras.optimizers.Optimizer will continue to be supported as tf.keras.optimizers.legacy.Optimizer" - Relevant to us since we use Optimizer's in learned detectors such as ClassifierDrift. It reads like there is no change until 2.11 but worth checking...
  • "RNG behavior change for tf.keras.initializers. Keras initializers will now use stateless random ops to generate random numbers." - I don't think we use initializers directly, but wondering if they might be used indirectly e.g. when models are cloned. This might affect the lack of determinism we see in some detectors (see Spot the diff drift detection- inconsistent results while multiple run #390 (comment)). Unlikely...

(labelling DO NOT MERGE pending investigation)

@ascillitoe ascillitoe added the DO NOT MERGE Do not merge this PR label Sep 7, 2022
@ascillitoe
Copy link
Contributor

  • "tf.keras.optimizers.experimental.Optimizer will graduate in Release 2.11, which means tf.keras.optimizers.Optimizer will be an alias of tf.keras.optimizers.experimental.Optimizer. The current tf.keras.optimizers.Optimizer will continue to be supported as tf.keras.optimizers.legacy.Optimizer" - Relevant to us since we use Optimizer's in learned detectors such as ClassifierDrift. It reads like there is no change until 2.11 but worth checking...

Update: Confirmed that these changes are not being made until 2.11. We will need to check that there are no relevant API changes when optimizers are updated in 2.11.

@ascillitoe
Copy link
Contributor

This had no effect...

@ascillitoe
Copy link
Contributor

Doing a final sanity check on test_all_notebooks here, and will check a random selection of excluded notebooks.

@ascillitoe
Copy link
Contributor

Probably makes sense to address tensorflow-probability issues before merging this: #616

@ascillitoe ascillitoe added this to the v0.11.0 milestone Sep 14, 2022
Updates the requirements on [tensorflow](https://github.com/tensorflow/tensorflow) to permit the latest version.
- [Release notes](https://github.com/tensorflow/tensorflow/releases)
- [Changelog](https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md)
- [Commits](tensorflow/tensorflow@v2.2.0...v2.10.0)

---
updated-dependencies:
- dependency-name: tensorflow
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/pip/tensorflow-gte-2.2.0-and-neq-2.6.0-and-neq-2.6.1-and-lt-2.11.0 branch from 897ef03 to b60f938 Compare September 27, 2022 15:34
Copy link
Contributor

@ascillitoe ascillitoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ascillitoe ascillitoe merged commit 5b14ab0 into master Oct 10, 2022
@dependabot dependabot bot deleted the dependabot/pip/tensorflow-gte-2.2.0-and-neq-2.6.0-and-neq-2.6.1-and-lt-2.11.0 branch October 10, 2022 16:12
@ascillitoe ascillitoe removed the DO NOT MERGE Do not merge this PR label Oct 10, 2022
ascillitoe pushed a commit that referenced this pull request Nov 8, 2022
Updates the requirements on [tensorflow](https://github.com/tensorflow/tensorflow) to permit the latest version.
- [Release notes](https://github.com/tensorflow/tensorflow/releases)
- [Changelog](https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md)
- [Commits](tensorflow/tensorflow@v2.2.0...v2.10.0)

---
updated-dependencies:
- dependency-name: tensorflow
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants