Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon icon indicating copy to clipboard operation
Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon copied to clipboard

tensorflow-text loading error

Open mheimschild opened this issue 3 years ago • 2 comments
trafficstars

Hello @sun1638650145 ! thank you for you great guide how to build lib on M1 Apple machines!

Following your instructions I was able to build the lib but when I try to load it in my notebook it fails with error

dlopen(/Users/xxxxxxx/conda/tf/lib/python3.9/site-packages/tensorflow_text/python/ops/_regex_split_ops.dylib, 0x0006): re-export ordinal -2 in /Users/xxxxxxx/conda/tf/lib/python3.9/site-packages/tensorflow_text/python/ops/_regex_split_ops.dylib out of range for __ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS5_10unique_ptrINS0_15OpKernelFactoryENS5_14default_deleteISB_EEEEsymbol not found in flat namespace '__ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS5_10unique_ptrINS0_15OpKernelFactoryENS5_14default_deleteISB_EEEE'

python --version Python 3.9.13

conda list | grep tensorflow tensorflow-addons 0.17.1 pypi_0 pypi tensorflow-deps 2.9.0 0 apple tensorflow-estimator 2.9.0 pypi_0 pypi tensorflow-hub 0.12.0 pypi_0 pypi tensorflow-macos 2.9.0 pypi_0 pypi tensorflow-metal 0.5.0 pypi_0 pypi tensorflow-text 2.9.0 pypi_0 pypi

nm /Users/xxxxxxx/conda/tf/lib/python3.9/site-packages/tensorflow_text/python/ops/_regex_split_ops.dylib | grep "__ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS5_10unique_ptrINS0_15OpKernelFactoryENS5_14default_deleteISB_EEEE" U __ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS5_10unique_ptrINS0_15OpKernelFactoryENS5_14default_deleteISB_EEEE I __ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS5_10unique_ptrINS0_15OpKernelFactoryENS5_14default_deleteISB_EEEE (indirect for __ZN10tensorflow14kernel_factory17OpKernelRegistrar12InitInternalEPKNS_9KernelDefENSt3__117basic_string_viewIcNS5_11char_traitsIcEEEENS5_10unique_ptrINS0_15OpKernelFactoryENS5_14default_deleteISB_EEEE)

Any help would be much appreciated

mheimschild avatar Jul 07 '22 09:07 mheimschild

Hello, I did find this bug. But now seeing that this issue is widely appearing on tensorflow_text 2.9, the issues of tensorflow_text have submitted multiple similar issues. The cause of this problem does not appear to be a problem with the build step.

sun1638650145 avatar Jul 08 '22 02:07 sun1638650145

Now there are about 3 methods you can try:

  1. You can directly download my pre-compiled whl file.
  2. Update tensorflow_macos to 2.9.2 and recompile.
  3. Change to a version of Python, currently Python 3.8 is the most stable.

Hope these methods are of some help to you.

sun1638650145 avatar Jul 08 '22 02:07 sun1638650145