TensorFlow Addons (Nightly)

raw JSON →
0.23.0.dev20240415222534 verified Fri May 01 auth: no python

Nightly pre-release builds of TensorFlow Addons, a library of maintained TensorFlow API extensions. Current version 0.23.0.dev (development). Published irregularly (nightly). Not stable; use TensorFlow Addons stable (tensorflow-addons) for production.

pip install tfa-nightly
error ModuleNotFoundError: No module named 'tensorflow_addons'
cause Installation failure or trying to import when package is not installed.
fix
Run: pip install tfa-nightly. Ensure the package is installed in the correct Python environment.
error AttributeError: module 'tensorflow' has no attribute 'keras'
cause Using nightly TensorFlow where tf.keras is not directly accessible (common in early TF 2.x).
fix
Use import tensorflow as tf; then access via tf.keras. If using tf-nightly, use import keras directly.
error ImportError: cannot import name 'LAMB' from 'tensorflow_addons.optimizers'
cause The API may have been removed in a nightly build or renamed.
fix
Check latest documentation at https://github.com/tensorflow/addons for correct import paths. Always pin a version.
error OSError: [Errno 2] No such file or directory: 'python3.10/site-packages/tensorflow_addons/...'
cause Incomplete installation or broken environment due to conflicting packages.
fix
Uninstall both tensorflow-addons and tfa-nightly, then install only tfa-nightly in a clean virtual environment.
breaking tfa-nightly is inherently unstable and may break at any time. APIs can change or disappear without notice. Use only for testing.
fix Pin to a specific nightly version and test thoroughly before updating.
gotcha tfa-nightly and tensorflow-addons (stable) cannot be installed together. They conflict because both install under the same namespace tensorflow_addons.
fix Use only one of them. Uninstall the other: pip uninstall tensorflow-addons tfa-nightly
deprecated TensorFlow Addons (including nightly) is in maintenance mode since TensorFlow 2.10. Many ops have been integrated into core or moved to tf.keras. The official recommendation is to use core TensorFlow functions where possible.
fix Migrate to core TensorFlow APIs. See https://github.com/tensorflow/addons#recommendation

Minimal working example: import tensorflow and tensorflow_addons, then use an optimizer from addons.

import tensorflow as tf
import tensorflow_addons as tfa

# Example: use a standard optimizer from addons
model = tf.keras.Sequential([tf.keras.layers.Dense(10)])
optimizer = tfa.optimizers.LAMB(learning_rate=0.001)
model.compile(optimizer=optimizer, loss='mse')
print('tfa installed and working')