tensorflow / compression

Data compression in TensorFlow
Apache License 2.0
858 stars 249 forks source link

tfc-2.9.1 import error #148

Closed gitlabspy closed 2 years ago

gitlabspy commented 2 years ago

TensorFlow version: 2.9.1-gpu TFC version: 2.9.1 # installed with pip install tensorflow-compression

got error when importing tfc

----> 2 import tensorflow_compression as tfc

/usr/local/lib/python3.7/dist-packages/tensorflow_compression/__init__.py in <module>
     15 """Data compression in TensorFlow."""
     16 
---> 17 from tensorflow_compression.python import distributions
     18 from tensorflow_compression.python import entropy_models
     19 from tensorflow_compression.python import layers

/usr/local/lib/python3.7/dist-packages/tensorflow_compression/python/distributions/__init__.py in <module>
     17 from tensorflow_compression.python.distributions.deep_factorized import *
     18 from tensorflow_compression.python.distributions.helpers import *
---> 19 from tensorflow_compression.python.distributions.round_adapters import *
     20 from tensorflow_compression.python.distributions.uniform_noise import *

/usr/local/lib/python3.7/dist-packages/tensorflow_compression/python/distributions/round_adapters.py in <module>
     20 from tensorflow_compression.python.distributions import helpers
     21 from tensorflow_compression.python.distributions import uniform_noise
---> 22 from tensorflow_compression.python.ops import round_ops
     23 
     24 

/usr/local/lib/python3.7/dist-packages/tensorflow_compression/python/ops/__init__.py in <module>
     15 """TensorFlow operations and functions."""
     16 
---> 17 from tensorflow_compression.python.ops.gen_ops import *
     18 from tensorflow_compression.python.ops.math_ops import *
     19 from tensorflow_compression.python.ops.padding_ops import *

/usr/local/lib/python3.7/dist-packages/tensorflow_compression/python/ops/gen_ops.py in <module>
     19 
     20 ops = load_library.load_op_library(resource_loader.get_path_to_datafile(
---> 21     "../../cc/libtensorflow_compression.so"))
     22 globals().update({n: getattr(ops, n) for n in dir(ops)})
     23 

/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/load_library.py in load_op_library(library_filename)
     52     RuntimeError: when unable to load the library or get the python wrappers.
     53   """
---> 54   lib_handle = py_tf.TF_LoadLibrary(library_filename)
     55   try:
     56     wrappers = _pywrap_python_op_gen.GetPythonWrappers(

NotFoundError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/python3.7/dist-packages/tensorflow_compression/python/ops/../../cc/libtensorflow_compression.so)
gitlabspy commented 2 years ago

Case above is in linux system. Also I found that mac m1 is not supported, any solution? (cannot install through pip install )

jonarchist commented 2 years ago

Hi, thanks for reporting. This looks like a problem with our wheel files. It might take a while to debug this. Can you tell us what linux distro and version you are using?

gitlabspy commented 2 years ago

Debian 10. I solved it by downgrading both tf and tfc to 2.8.0, which does not require GLIBC_2.29.

jonarchist commented 2 years ago

The 2.9.2 release should fix this problem. Would you mind trying this on your system and confirming? Thanks.

gitlabspy commented 2 years ago

It works fine now! M1 chip mac can not install through pip install tensorflow-compression , No matching distribution found for tensorflow-compression...

jonarchist commented 2 years ago

Great, thanks for confirming. Regarding M1, unfortunately we don't have binaries available for that platform yet. We will consider to add them once TensorFlow has binary packages for M1.