io: Can not build `tensorflow-io` from source on Apple M1
-
First I tried using
python setup.py bdist_wheel, which buildswheel, but the installation prompts meERROR: Could not find a version that satisfies the requirement tensorflow-io-gcs-filesystem==0.24.0 (from tensorflow-io) (from versions: none) ERROR: No matching distribution found for tensorflow-io-gcs-filesystem==0.24.0So I changed it to install
pip install dist/tensorflow_io-0.24.0-cp38-cp38-macosx_11_0_arm64.whl --no-depswithout dependencies, so although it can be installed normally, it will prompt me that there is no dynamic library when running/Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/__init__.py:98: UserWarning: unable to load libtensorflow_io_plugins.so: unable to open file: libtensorflow_io_plugins.so, from paths: ['/Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/libtensorflow_io_plugins.so'] caused by: ["[Errno 2] The file to load file system plugin from does not exist.: '/Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/libtensorflow_io_plugins.so'"] warnings.warn(f"unable to load libtensorflow_io_plugins.so: {e}") /Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/__init__.py:104: UserWarning: file system plugins are not loaded: unable to open file: libtensorflow_io.so, from paths: ['/Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/libtensorflow_io.so'] caused by: ["dlopen(/Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/libtensorflow_io.so, 0x0006): tried: '/Users/sunruiqi/Desktop/io-0.24.0/tensorflow_io/python/ops/libtensorflow_io.so' (no such file), '/usr/local/lib/libtensorflow_io.so' (no such file), '/usr/lib/libtensorflow_io.so' (no such file)"] warnings.warn(f"file system plugins are not loaded: {e}") -
After the above method fails, I refer to the build method in the documentation, unfortunately, run this command
bazel build -s --verbose_failures $BAZEL_OPTIMIZATION //tensorflow_io/... //tensorflow_io_gcs_filesystem/...will produce the following error:ERROR: While resolving toolchains for target //tensorflow_io/core:golang_ops: no matching toolchains found for types @io_bazel_rules_go//go:toolchain ERROR: Analysis of target '//tensorflow_io/core:golang_ops' failed; build aborted: no matching toolchains found for types @io_bazel_rules_go//go:toolchainSo, what should I do?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 8
- Comments: 32 (4 by maintainers)
@ZaibanAli Thank you very much for your help, but still there is no dynamic library error.
@flippinroo2
tensorflowdoes not seem to be planning official support for Apple silicon. I have provided severaltensorflowlibrarieswhlfiles, and if you need them, you can download them directly from here.I’m receiving the same warnings
Tried using an arm64 tensorflow_addons wheel as provided by @sun1638650145, but the warnings persist.
still, I am able to run objecte detection jobs (https://www.tensorflow.org/hub/tutorials/tf2_object_detection).
@yongtang Any update yet? I’m running into this issue as well. It does not let me use
tfio.audioas a result.What would be a workaround you recommend?
@yongtang no dependency issues on my side.
Now,
iocan be built perfectly on Apple silicon. If anyone needs it, you can find the tutorial here. I hope it can be helpful to everyone.I’m getting this message on every run, and it takes some like 5 seconds. After that the script follows.
Using a conda environment, this is my build and install results:
Thank you for your attention @kulinseth
Hi @sun1638650145 and @TiagoGouvea , can you please paste the build error ?
I built
tensorflowfrom source, without usingtensorflow-macos, but I’m still having issues buildingtensorflow-io.The only difference I can see, is that I haven’t installed XCode (only use command line tools). I can try install xcode.
@ZaibanAli @sun1638650145 My recent M1 laptop is having a firmware issue and is with apple repair now. I may only be able to take a look at building tensorflow-io after the laptop is back.
Before the firmware issue I was using pip to install tensorflow_macos though I remember I had an issue with hdf5 dependency. Do you encounter the same hdf5 dependencies?