{"id":4800,"library":"tensorflow-addons","title":"TensorFlow Addons","description":"TensorFlow Addons (TFA) is a repository of contributions that conform to well-established API patterns, but implement new functionality not available in core TensorFlow. It provides a curated collection of specialized layers, optimizers, losses, metrics, and other operations. As of its 0.23.0 version, TFA has ended development and introduction of new features, entering a minimal maintenance and release mode until a planned end of life in May 2024.","status":"deprecated","version":"0.23.0","language":"en","source_language":"en","source_url":"https://github.com/tensorflow/addons","tags":["tensorflow","deep learning","machine learning","neural networks","keras","addons"],"install":[{"cmd":"pip install tensorflow-addons","lang":"bash","label":"Stable release"},{"cmd":"pip install tensorflow-addons[tensorflow]","lang":"bash","label":"With compatible TensorFlow version"}],"dependencies":[{"reason":"TensorFlow Addons provides functionality that extends TensorFlow and requires a compatible version of TensorFlow to be installed.","package":"tensorflow"}],"imports":[{"symbol":"tfa","correct":"import tensorflow_addons as tfa"},{"symbol":"tfa.activations","correct":"import tensorflow_addons.activations as tfa_activations"},{"symbol":"tfa.layers","correct":"import tensorflow_addons.layers as tfa_layers"},{"symbol":"tfa.optimizers","correct":"import tensorflow_addons.optimizers as tfa_optimizers"},{"symbol":"tfa.losses","correct":"import tensorflow_addons.losses as tfa_losses"},{"symbol":"tfa.metrics","correct":"import tensorflow_addons.metrics as tfa_metrics"}],"quickstart":{"code":"import tensorflow as tf\nimport tensorflow_addons as tfa\n\n# Define a simple Keras model with a TFA layer and optimizer\nmodel = tf.keras.Sequential([\n    tf.keras.layers.InputLayer(input_shape=(10,)),\n    tf.keras.layers.Dense(128, activation='relu'),\n    tfa.layers.GroupNormalization(groups=8, axis=-1), # Example TFA layer\n    tf.keras.layers.Dense(10, activation='softmax')\n])\n\n# Use a TFA optimizer\noptimizer = tfa.optimizers.AdamW(weight_decay=0.001, learning_rate=0.001)\n\nmodel.compile(optimizer=optimizer,\n              loss='sparse_categorical_crossentropy',\n              metrics=['accuracy'])\n\n# Create dummy data\nimport numpy as np\nx_train = np.random.rand(100, 10).astype(np.float32)\ny_train = np.random.randint(0, 10, 100)\n\nprint(\"Model summary:\")\nmodel.summary()\n\nprint(\"\\nTraining model with TFA components...\")\nmodel.fit(x_train, y_train, epochs=1, batch_size=32, verbose=0)\nprint(\"Training complete.\")","lang":"python","description":"This quickstart demonstrates how to integrate a TensorFlow Addons layer (`GroupNormalization`) and an optimizer (`AdamW`) into a standard Keras model. It compiles and runs a single training epoch with dummy data."},"warnings":[{"fix":"Migrate functionality to core TensorFlow, Keras, or other specialized TensorFlow community libraries. Review release notes for specific component migration paths.","message":"TensorFlow Addons (TFA) has reached its planned end of life in May 2024. Development of new features has ceased, and the library is in a minimal maintenance mode. Users are advised to migrate to other TensorFlow community repositories (e.g., Keras, Keras-CV, Keras-NLP).","severity":"breaking","affected_versions":"0.x.x (post-May 2024)"},{"fix":"Always install `tensorflow-addons` with the `[tensorflow]` extra (e.g., `pip install tensorflow-addons[tensorflow]`) or verify the compatibility matrix on the official GitHub page. Avoid `conda`-installed TensorFlow for custom ops.","message":"Compatibility with TensorFlow versions is crucial. TensorFlow Addons is only guaranteed to be compatible with the TensorFlow versions it was tested against. Warnings will be emitted if versions do not match, and custom C++ operations may lead to segmentation faults or crashes with incompatible TensorFlow builds (e.g., `conda` installations).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the `tensorflow-addons` release notes and documentation for specific replacements. For `gelu`, use `tf.keras.activations.gelu` or `tf.nn.gelu`.","message":"Some functionalities, like `tfa.activations.gelu` and `data_format` arguments in `tensorflow_addons/image`, have been deprecated, with `gelu` migrating to core TensorFlow.","severity":"deprecated","affected_versions":"0.12.0 and later"},{"fix":"Use Linux or macOS for full `tensorflow-addons` functionality, especially for GPU custom operations. If on Windows, be aware of potential performance implications or missing custom op functionality.","message":"Windows support for `tensorflow-addons` was dropped due to inconsistent TensorFlow 2.15 `.whl` packaging. Users on Windows will fall back to pure TensorFlow Python implementations where possible for custom ops.","severity":"breaking","affected_versions":"All versions (post TF 2.15 incompatibility)"},{"fix":"Regularly check release notes and changelogs when upgrading `tensorflow-addons` to understand any API modifications.","message":"APIs in TensorFlow Addons might evolve more rapidly than those in core TensorFlow. While the SIG strives for stability, frequent updates can introduce changes.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}