sun1638650145 / Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon

This Repo will provide TensorFlow libraries and extended build tutorials that require compilation to build, as well as pre-compiled wheel files.
115 stars 9 forks source link

Is there a way to run object detection api on Macos 12 #3

Closed kumarpriyanshu2k2 closed 1 year ago

sun1638650145 commented 2 years ago

Please describe in detail, are you referring to tensorflow-io support?

kumarpriyanshu2k2 commented 2 years ago

yes, I am not able to install tensorflow io in my conda environment Screenshot 2022-05-23 at 4 37 19 PM

❯ python3 -m pip install --no-deps dist/tensorflow_io-0.26.0-cp39-cp39-macosx_11_0_arm64.whl ERROR: tensorflow_io-0.26.0-cp39-cp39-macosx_11_0_arm64.whl is not a supported wheel on this platform.

sun1638650145 commented 2 years ago

This approach works with the Object Detection API, but the support is not perfect. For this reason, I haven't written a tensorflow-io tutorial.

  1. Use virtualenv to create an environment (please do not use conda to create new environments!).

    python3 -m venv ~/tensorflow-macos
    source ~/tensorflow-macos/bin/activate
  2. Install hdf5 (please do not use conda pre-compiled hdf5!).

    brew install hdf5
    export CPATH="/opt/homebrew/include/"
    export HDF5_DIR="/opt/homebrew/"
  3. Install the tensorflow-macos and tensorflow-metal plugins.

    pip install tensorflow-macos==2.9.0
    pip install tensorflow-metal==0.5.0
  4. Download and extract io 0.26.0.

    wget https://github.com/tensorflow/io/archive/refs/tags/v0.26.0.zip
    unzip v0.26.0.zip
    cd io-0.26.0
  5. Build io.

    python setup.py -q bdist_wheel --project tensorflow_io_gcs_filesystem
    python setup.py -q bdist_wheel
  6. Install the whl file (please install the tensorflow_io_gcs_filesystem first, and use the --no-deps parameter).

    pip install --no-deps ./dist/tensorflow_io_gcs_filesystem-0.25.0-cp39-cp39-macosx_12_0_arm64.whl
    pip install --no-deps ./dist/tensorflow_io-0.25.0-cp39-cp39-macosx_12_0_arm64.whl
kumarpriyanshu2k2 commented 2 years ago

It worked (with a warning) Thank you so much.

sun1638650145 commented 2 years ago

I won't close this issue since io can not be built perfectly yet. If you still need it, you can continue to follow it, and I will close it when I can build it perfectly.

sun1638650145 commented 1 year ago

@kumarpriyanshu2k2 Now, io can be built perfectly on Apple silicon. You can find a tutorial here or directly download the whl file.