TensorFlow 2.12 Deprecates experimental.preprocessing: Is It Safe Under mixed_float16?
0 reputation · 09 Jun 2024, 21:20 UTC
TensorFlow 2.12 marks tf.keras.layers.experimental.preprocessing as deprecated, pointing users to the stable tf.keras.layers.preprocessing namespace, with removal slated for the 2.13 release. Code written against 2.11 continues to run under 2.12, but emits deprecation warnings and is expected to break once the experimental namespace disappears.
The migration itself looks mechanical, since the stable namespace exposes the same layer names such as Normalization and TextVectorization. The open issue is numeric behavior: mixed-precision training via tf.keras.mixed_precision.set_global_policy('mixed_float16') is not exhaustively documented for the legacy aliases, and it is unclear whether they wrap the same implementations as the stable classes or cast dtypes differently during adapt() and forward passes.
Before committing to a small-scale side-by-side validation ahead of any production rollout, three points need resolving:
- Do the 2.12 experimental aliases delegate to the stable
tf.keras.layers.preprocessingimplementations, or are they frozen copies that could diverge in dtype handling under a mixed_float16 policy? - Does the scheduled 2.13 removal fail at import time, at layer construction, or only when loading saved models that reference the old path?
- Which warnings or silent dtype conversions should a mixed-precision smoke test be designed to surface before the upgrade?