Using TensorFlow addons on Mac with M1

These days I am building an image classifier using an unbalanced dataset. So instead of Accuracy, I am more interested in viewing Precision and Recall, or the F1 score.

The F1 score metric is implemented by https://www.tensorflow.org/addons/api_docs/python/tfa/metrics/F1Score. So I went to the TensorFlow addons page to see how to install it.

tensorflow/addons
Useful extra functionality for TensorFlow 2.x maintained by SIG-addons - tensorflow/addons

In theory, all I need to do, even on macOS, is to run pip install tensorflow-addons. However, when I did, it returned this:

% pip install tensorflow-addons
ERROR: Could not find a version that satisfies the requirement tensorflow-addons (from versions: none)
ERROR: No matching distribution found for tensorflow-addons

The README does show a compatibility table that states that the latest version is compatible with TensorFlow 2.5 and Python 3.9. My guess is that its setup.py states dependencies to tensorflow, whereas I have tensorflow-macos installed:

% pip list
Package                 Version
----------------------- -------------------
...
tabulate                0.8.9
tensorboard             2.5.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit  1.8.0
tensorflow-estimator    2.5.0
tensorflow-macos        2.5.0 <--
tensorflow-metal        0.1.1
termcolor               1.1.0
...

One way to verify this would be to git clone the repository, modify setup.py and follow the steps to install from Source.

For now I filed a ticket at https://github.com/tensorflow/addons/issues/2503.