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

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

Open preyawnshoe opened this issue 3 years ago • 5 comments
trafficstars

preyawnshoe avatar May 22 '22 11:05 preyawnshoe

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

sun1638650145 avatar May 23 '22 06:05 sun1638650145

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.

preyawnshoe avatar May 23 '22 11:05 preyawnshoe

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
    

sun1638650145 avatar May 24 '22 09:05 sun1638650145

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

preyawnshoe avatar May 27 '22 02:05 preyawnshoe

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 avatar May 27 '22 02:05 sun1638650145

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

sun1638650145 avatar Sep 09 '23 04:09 sun1638650145