Giter Site home page Giter Site logo

Comments (4)

jonycgn avatar jonycgn commented on June 2, 2024

Hi! Thanks for reaching out.

Our automated build system currently doesn't support building for M1 (from what I can tell, it might become available Q1 2023), but it would be great to know if you encounter any issues with building it on your system.

Have you tried to follow the instructions for building pip packages under Darwin?

Thanks!

from compression.

yingding avatar yingding commented on June 2, 2024

I followed the instruction to build pip packages under Darwin on Apple silicon, need to change the requirements.txt

# tensorflow ~= 2.10.0
tensorflow-macos ~= 2.10.0

Run a test with python3 -m tensorflow_compression.all_tests
got

...
[ RUN      ] tensorflow_compression.python.entropy_models.continuous_indexed_test.ContinuousIndexedEntropyModelTest.test_compression_works_in_tf_function
2022-11-02 22:47:00.146878: W tensorflow/core/framework/op_kernel.cc:1780] OP_REQUIRES failed at functional_ops.cc:374 : INTERNAL: No function library
...
Ran 341 tests in 677.321s
FAILED (errors=5, skipped=31)

Imported tensorflow-compression in my python3.10 venv import tensorflow_compression as tfc and got the error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/__init__.py", line 17, in <module>
    from tensorflow_compression.python import distributions
  File "/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/python/distributions/__init__.py", line 19, in <module>
    from tensorflow_compression.python.distributions.round_adapters import *
  File "/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/python/distributions/round_adapters.py", line 22, in <module>
    from tensorflow_compression.python.ops import round_ops
  File "/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/python/ops/__init__.py", line 17, in <module>
    from tensorflow_compression.python.ops.gen_ops import *
  File "/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/python/ops/gen_ops.py", line 20, in <module>
    ops = load_library.load_op_library(resource_loader.get_path_to_datafile(
  File "/Users/yingding/VENV/metal3.10/lib/python3.10/site-packages/tensorflow/python/framework/load_library.py", line 54, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: dlopen(/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/python/ops/../../cc/libtensorflow_compression.so, 0x0006): tried: '/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/python/ops/../../cc/libtensorflow_compression.so' (no such file), '/Users/yingding/VCS/build/tensorflow_compression/tensorflow_compression/cc/libtensorflow_compression.so' (no such file)

Any thoughts on this? Would be really great to have pre-compiled pages for apple silicon.

from compression.

jonycgn avatar jonycgn commented on June 2, 2024

If you didn't get an error building the package, then that seems promising!

It looks like it's trying to access libtensorflow_compression.so, but in Darwin, the name should end in .dylib. Perhaps under M1, Darwin uses a different OS identifier here (instead of mac): https://github.com/tensorflow/compression/blob/master/workspace.bzl#L24

You might want to patch that file to use .dylib. Can you see if that helps?

Also, we recently needed to update this to read .2.dylib. In 2.10.0 it might still just be .dylib.

from compression.

 avatar commented on June 2, 2024

Did anyone get it built on apple silicon?

from compression.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.