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

build: bump TensorFlow to 2.3.0 #1051

Merged
merged 2 commits into from
Aug 7, 2020

Conversation

compnerd
Copy link
Contributor

The TensorFlow 2.3.0 release is GA'ed. Update the version that we use.

@compnerd compnerd force-pushed the tensorflow-2.3.0 branch 4 times, most recently from 2aa33d0 to 18b57ca Compare July 31, 2020 16:25
@texasmichelle
Copy link
Member

I believe that setting reshuffleForEachIterator explicitly to false will resolve the test failure:

let shuffled = dataset.shuffled(sampleCount: 5, randomSeed: 42, reshuffleForEachIterator: false)

@texasmichelle
Copy link
Member

The failure is caused by shuffle behaving differently, which I suspect is caused by an upstream bugfix. Datasets.shuffled() defaults to reshuffleForEachIterator: true, which did not have any effect before.

Here's a reduction:

import TensorFlow

let scalars = Tensor<Float>(rangeFrom: 0, to: 5, stride: 1)
let dataset = Dataset(elements: scalars)
print("dataset: \(dataset.flatMap { $0.scalars })")
let shuffled = dataset.shuffled(sampleCount: 5, randomSeed: 42)
print("shuffled: \(shuffled.flatMap { $0.scalars })")
print("shuffled: \(shuffled.flatMap { $0.scalars })")
print("shuffled: \(shuffled.flatMap { $0.scalars })")

Nightlies:

dataset: [0.0, 1.0, 2.0, 3.0, 4.0]
shuffled: [0.0, 4.0, 1.0, 3.0, 2.0]
shuffled: [0.0, 4.0, 1.0, 3.0, 2.0]
shuffled: [0.0, 4.0, 1.0, 3.0, 2.0]

TF 2.3:

dataset: [0.0, 1.0, 2.0, 3.0, 4.0]
shuffled: [0.0, 4.0, 1.0, 3.0, 2.0]
shuffled: [3.0, 4.0, 1.0, 0.0, 2.0]
shuffled: [2.0, 4.0, 3.0, 0.0, 1.0]

Passing in reshuffleForEachIterator: false gives us behavior that matches TF 2.2:

dataset: [0.0, 1.0, 2.0, 3.0, 4.0]
shuffled: [2.0, 1.0, 3.0, 4.0, 0.0]
shuffled: [2.0, 1.0, 3.0, 4.0, 0.0]
shuffled: [2.0, 1.0, 3.0, 4.0, 0.0]

@texasmichelle
Copy link
Member

I wonder why the shuffled values are different, given the same seed? It's probably fine just to update the expected values in the test.

The TensorFlow 2.3.0 release is GA'ed.  Update the version that we use.

Adjust the XLA Client logging for API changes in the latest TensorFlow
release.

Avoid the re-shuffling of the tensor during the tests.  Thanks to
@texasmichelle for tracking down the issue with the test failure!
Co-authored-by: Michelle Casbon <texasmichelle@users.noreply.github.com>
@compnerd compnerd merged commit 7dccb8a into tensorflow:master Aug 7, 2020
@compnerd compnerd deleted the tensorflow-2.3.0 branch August 7, 2020 14:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants