The root cause is that we have some internal cache field, which is not picklable by python.
Fix https://github.com/tensorflow/tensorflow/issues/39978.
PiperOrigin-RevId: 314265192
Change-Id: I66e80dea5fb65ac9c2e567f2af74510cd64ce5fc
The experimental_run_tf_function parameter no longer has any effect.
I didn't remove the functionality from testing_util.py and keras_parameterized.py to run with experimental_run_tf_function being True and False. I will remove that functionality in a future change.
PiperOrigin-RevId: 297674422
Change-Id: I5b1e67f78b4c3b60242241fb4dc2018f0ace6013
1. when calling predict without compiling first.
2. when using a tf.compat.v1.optimizers.Optimizer (these work eagerly & should work in the v2 loops)
This revealed some missing coverage in the tests & a few bugs.
The fixes to these issues are are:
1. Int sample weights used with masks now work correctly (w/o type crashes)
2. Keras in TF2 explicitly disallows using sparse scipy matrices as inputs to dense functional model inputs. A meaningful error is now raised whereas before this crashed w/ unclear messages. In v1 the scipy matrices were silently cast to dense arrays, but this causes ambiguity for subclass models & can't be done w/o too much extra complexity for the data adapters.
3. This cl needs to mark a few tests that depend on v2 dtype behavior as run_v2_only, and changes a few tests to v1_deprecated
PiperOrigin-RevId: 277148078
Change-Id: Ic794104d85f999f0b449cc606df85f1e4cc5b8ed
1. when calling predict without compiling first.
2. when using a tf.compat.v1.optimizers.Optimizer (these work eagerly & should work in the v2 loops)
This revealed some missing coverage in the tests & a few bugs.
The fixes to these issues are are:
1. Int sample weights used with masks now work correctly (w/o type crashes)
2. Keras in TF2 explicitly disallows using sparse scipy matrices as inputs to dense functional model inputs. A meaningful error is now raised whereas before this crashed w/ unclear messages. In v1 the scipy matrices were silently cast to dense arrays, but this causes ambiguity for subclass models & can't be done w/o too much extra complexity for the data adapters.
3. This cl needs to mark a few tests that depend on v2 dtype behavior as run_v2_only, and changes a few tests to v1_deprecated
PiperOrigin-RevId: 276388163
Change-Id: I0c31e4e6aa16793f119f6f0184a93b294db3d030
recurrent_dropout is enabled.
This is raised by https://github.com/tensorflow/tensorflow/issues/32987.
In short, implementation 2 was applying one dropout mask to the
recurrent state, rather than having different mask for different gates.
Updating the implementation 2 to dropout on individual gates might make
it very similar as 1, which is why we fallback 1 when recurrent_dropout
is enabled.
PiperOrigin-RevId: 275336490
Change-Id: Ib853339b1033cb4d7c343e8adb349fa9a573fdd3
1. Change the assertion to be ValueError for better stacktrace and error
context.
2. Adding slight comment for rnn() since the body of it too long.
#32570
PiperOrigin-RevId: 271199425
In TF 2, this makes RNNs work properly when a non-float32 dtype is passed to them. ConvLSTM2D is still broken with non-float32 dtypes however, as it calls tf.zeros() in various places without passing the correct dtype.
PiperOrigin-RevId: 261368927
Failed tests are all disabled for now, and we should address them while we updating the v2 training path and util functions.
PiperOrigin-RevId: 258267130
sequence model was incorrectly using the layer output instead of input to generate mask, and compute_mask of the layer usually does not have shape check.
PiperOrigin-RevId: 227605298
Skip individual test cases or entire suites that are not
running in v1. Also replace some @run_deprecated_v1
annotations since simply running the test in graph mode
was not enough.
PiperOrigin-RevId: 224604547
This test case usually took too long to execute, and cause that test shard to time out. Use paramsterized test so that each implementation mode are now split into separate test case.
PiperOrigin-RevId: 223815273
The existing logic assumes the state[0] of the step function is same as the
output, which is not necessary true anymore. Update the logic to read the
outputs from the previous steps.
PiperOrigin-RevId: 220816333
self.test_session() has been deprecated in 9962eb5e84 as its name confuses readers of the test. Moving to cached_session() instead which is more explicit about:
* the fact that the session may be reused.
* the session is not closed even when doing a "with self.test_session()" statement.
PiperOrigin-RevId: 212336417