tensorflow / tensorflow/models

Cannot build/test Object Detection API on macOS M1

Open
#10,769 1 comment 0 reactions 3 assignees View on GitHub

Nobody has claimed this yet.

models:research models:research:odapi type:bug
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

  1. Have a Mac with an M1 chip running macOS 12.5.1.
  2. Install tensorflow-macos 2.9.2, tensorflow-metal 0.5.1.
  3. Follow the Python Package Installation steps in the Object Detection API with TensorFlow 2 document in this repo (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md).
  1. Try to run python object_detection/builders/model_builder_tf2_test.py - note ImportError.
  2. Follow the workaround to make proto.internal.builder available here: https://github.com/tensorflow/models/issues/10429#issuecomment-12412353886.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.