tensorflow 2.20 broken support

Hi, testing latest tensorflow-metal plugin with tensorflow 2.20 doesn't work..

using python Python 3.12.11 (main, Jun 3 2025, 15:41:47) [Clang 17.0.0 (clang-1700.0.13.3)] on darwin

simple testing shows error:

import tensorflow as tf

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow/init.py", line 438, in <module> _ll.load_library(_plugin_dir) File "/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow/python/framework/load_library.py", line 151, in load_library py_tf.TF_LoadLibrary(lib) tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/libmetal_plugin.dylib, 0x0006): Library not loaded: @rpath/_pywrap_tensorflow_internal.so Referenced from: <8B62586B-B082-3113-93AB-FD766A9960AE> /Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/libmetal_plugin.dylib Reason: tried: '/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/../_solib_darwin_arm64/_U@local_Uconfig_Utf_S_S_C_Upywrap_Utensorflow_Uinternal___Uexternal_Slocal_Uconfig_Utf/_pywrap_tensorflow_internal.so' (no such file), '/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/../_solib_darwin_arm64/_U@local_Uconfig_Utf_S_S_C_Upywrap_Utensorflow_Uinternal___Uexternal_Slocal_Uconfig_Utf/_pywrap_tensorflow_internal.so' (no such file), '/opt/homebrew/lib/_pywrap_tensorflow_internal.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/_pywrap_tensorflow_internal.so' (no such file)

tf.config.experimental.list_physical_devices('GPU')

Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'tf' is not defined

I fixed this error by copying _pywrap_tensorflow_internal.so where it's searched..

1)mkdir /Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/../_solib_darwin_arm64

2)mkdir /Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/../_solib_darwin_arm64/_U@local_Uconfig_Utf_S_S_C_Upywrap_Utensorflow_Uinternal___Uexternal_Slocal_Uconfig_Utf/

3)cp /Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so /Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/../_solib_darwin_arm64/_U@local_Uconfig_Utf_S_S_C_Upywrap_Utensorflow_Uinternal___Uexternal_Slocal_Uconfig_Utf/

then fails symbol not found:

Symbol not found: __ZN10tensorflow28_AttrValue_default_instance_E in libmetal_plugin.dylib

full log:

with import tensorflow as tf Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow/init.py", line 438, in <module> _ll.load_library(_plugin_dir) File "/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow/python/framework/load_library.py", line 151, in load_library py_tf.TF_LoadLibrary(lib) tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/libmetal_plugin.dylib, 0x0006): Symbol not found: __ZN10tensorflow28_AttrValue_default_instance_E Referenced from: <8B62586B-B082-3113-93AB-FD766A9960AE> /Users/obg/npu/venv-tf/lib/python3.12/site-packages/tensorflow-plugins/libmetal_plugin.dylib Expected in: <2FF91C8B-0CB6-3E66-96B7-092FDF36772E> /Users/obg/npu/venv-tf/lib/python3.12/site-packages/_solib_darwin_arm64/_U@local_Uconfig_Utf_S_S_C_Upywrap_Utensorflow_Uinternal___Uexternal_Slocal_Uconfig_Utf/_pywrap_tensorflow_internal.so

Answered by DTS Engineer in 860814022

Hello,

Claiming support for Python 3.9 or greater is a bit misleading here.

According to the Troubleshooting section:

"Error: “Could not find a version that satisfies the requirement tensorflow-macos (from versions: none).” A tensorflow installation wheel that matches the current Python environment couldn’t be found by the package manager. Check that the Python version used in the environment is supported (Python 3.9, Python 3.10)."

which implies only 3.9 and 3.10 are fully supported.

Please send us an enhancement request for Python 3.9 - 3.12.x support.

Note there are other developers asking as well. See https://developer.apple.com/forums/thread/800939

Hello,

Claiming support for Python 3.9 or greater is a bit misleading here.

According to the Troubleshooting section:

"Error: “Could not find a version that satisfies the requirement tensorflow-macos (from versions: none).” A tensorflow installation wheel that matches the current Python environment couldn’t be found by the package manager. Check that the Python version used in the environment is supported (Python 3.9, Python 3.10)."

which implies only 3.9 and 3.10 are fully supported.

Please send us an enhancement request for Python 3.9 - 3.12.x support.

Note there are other developers asking as well. See https://developer.apple.com/forums/thread/800939

tensorflow 2.20 broken support
 
 
Q