tensorflow / tensorflow/models
Cannot build/test Object Detection API on macOS M1
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- [*] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
- [*] I am reporting the issue to the correct repository. (Model Garden official or research directory)
- [*] I checked to make sure that this issue has not already been filed.
1. The entire URL of the file you are using
N/A
2. Describe the bug
I'm following this official guide for getting starting with the Object Detection API with TF2: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md
After manually cloning and building tensorflow/io (necessary on macOS/M1 at this point), the only way to get model_builder_tf2_test.py to run is to follow the hack I describe here to make protobuf.internal.builder available.
3. Steps to reproduce
- Have a Mac with an M1 chip running macOS 12.5.1.
- Install
tensorflow-macos2.9.2,tensorflow-metal0.5.1. - Follow the Python Package Installation steps in the
Object Detection API with TensorFlow 2document in this repo (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md).
- You'll have to manually build and install
tensorflow_ioandtensorflow_io_gcs_filesystem, see https://stackoverflow.com/questions/70277737/cant-install-tensorflow-io-on-m1. - Some packages need to be installed with
pip --no-dependencies.
- Try to run
python object_detection/builders/model_builder_tf2_test.py- note ImportError. - Follow the workaround to make
proto.internal.builderavailable here: https://github.com/tensorflow/models/issues/10429#issuecomment-12412353886. - Run
python object_detection/builders/model_builder_tf2_test.py- success.
4. Expected behavior
I can successfully install and test the Object Detection API using python object_detection/builders/model_builder_tf2_test.py without having to manually copy files into my python site-packages folder.
5. Additional context
N/A
6. System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 12.5.2
- Mobile device name if the issue happens on a mobile device:
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): tensorflow-macos 2.9.2
- Python version: 3.8.13
- Bazel version (if compiling from source): N/A
- GCC/Compiler version (if compiling from source): N/A
- CUDA/cuDNN version: N/A
- GPU model and memory: Mac M1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.