tensorflow_addons
is dead:
$ python3
>>> from tensorflow_addons.metrics import RSquare
2024-07-26 18:50:12.659714: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-07-26 18:50:12.661619: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-07-26 18:50:12.673466: I external/local_xla/xla/tsl/cuda/cudart_stub.cc:32] Could not find cuda drivers on your machine, GPU will not be used.
2024-07-26 18:50:12.717156: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-07-26 18:50:12.789897: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:8454] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-07-26 18:50:12.811768: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-07-26 18:50:12.859591: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-07-26 18:50:18.850295: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
my_virtualenv_dir/lib/python3.11/site-packages/tensorflow_addons/utils/tfa_eol_msg.py:23: UserWarning:
TensorFlow Addons (TFA) has ended development and introduction of new features.
TFA has entered a minimal maintenance and release mode until a planned end of life in May 2024.
Please modify downstream libraries to take dependencies from other repositories in our TensorFlow community (e.g. Keras, Keras-CV, and Keras-NLP).
For more information see: https://github.com/tensorflow/addons/issues/2807
warnings.warn(
my_virtualenv_dir/lib/python3.11/site-packages/tensorflow_addons/utils/ensure_tf_install.py:53: UserWarning: Tensorflow Addons supports using Python ops for all Tensorflow versions above or equal to 2.13.0 and strictly below 2.16.0 (nightly versions are not supported).
The versions of TensorFlow you are currently using is 2.17.0 and is not supported.
Some things might work, some things might not.
If you were to encounter a bug, do not file an issue.
If you want to make sure you're using a tested and supported configuration, either change the TensorFlow version or the TensorFlow Addons's version.
You can find the compatibility matrix in TensorFlow Addon's readme:
https://github.com/tensorflow/addons
warnings.warn(
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "my_virtualenv_dir/lib/python3.11/site-packages/tensorflow_addons/__init__.py", line 23, in <module>
from tensorflow_addons import activations
File "my_virtualenv_dir/lib/python3.11/site-packages/tensorflow_addons/activations/__init__.py", line 17, in <module>
from tensorflow_addons.activations.gelu import gelu
File "my_virtualenv_dir/lib/python3.11/site-packages/tensorflow_addons/activations/gelu.py", line 19, in <module>
from tensorflow_addons.utils.types import TensorLike
File "my_virtualenv_dir/lib/python3.11/site-packages/tensorflow_addons/utils/types.py", line 29, in <module>
from keras.src.engine import keras_tensor
ModuleNotFoundError: No module named 'keras.src.engine'
Given that the above ends in an error, what to use instead of RSquare()
in
from tensorflow_addons.metrics import RSquare
model.compile(loss=keras.losses.MeanSquaredError,optimizer=keras.optimizers.Adam(),metrics=[RSquare()])
?
R2Score
class from tensorflow? $\endgroup$model.compile(metric=[…])
. $\endgroup$Metric
class, which can be used with thecompile
API (see the second code snippet on the documentation page). $\endgroup$