tensorflow / models

Models and examples built with TensorFlow
Other
76.99k stars 45.78k forks source link

Could you please add support for Apple's M1 chip for running Mobilenet SSD V2 training #10429

Open getabhishekified opened 2 years ago

getabhishekified commented 2 years ago

Prerequisites

Please answer the following question for yourself before submitting an issue.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf2.md

2. Describe the feature you request

I tried installing the Mobilenet SSD V2 on Apple's Mac M1 chip laptop, but getting error on running this command: python -m pip install --use-feature=2020-resolver .

error: ERROR: Could not find a version that satisfies the requirement tensorflow_io (from object-detection) (from versions: none) ERROR: No matching distribution found for tensorflow_io

4. Are you willing to contribute it? (Yes or No)

No. I am a beginner.

vineetsharma14 commented 2 years ago

I am having a similar issue. I have installed Tensorflow Mac OS using miniforge3 as per the instruction mentioned on the link : https://developer.apple.com/metal/tensorflow-plugin/

I have verified that the Tensorflow is correctly installed and is using the GPU on the M1 Mac.

I then tried to installed Tensorflow Object Detection API (tried both version 1 and 2); but the installation always gives error on the command "python -m pip install --use-feature=2020-resolver ."

Can someone please clarify - if we can use Tensorflow Object Detection API on Mac with Apple M1 Chip. If yes, it would be great if someone can provide us with the installation steps to follow.

Thanks.

dusskapark commented 2 years ago

Same problem here.

I got error messages below:

// python -m pip install .

ERROR: Could not find a version that satisfies the requirement tensorflow_io (from object-detection) (from versions: none)
ERROR: No matching distribution found for tensorflow_io
AritroSaha10 commented 2 years ago

Here's a similar issue on the Tensorflow IO repo: https://github.com/tensorflow/io/issues/1625

divyansh-kumar commented 2 years ago

Same problem here.

I got error messages below:

// python -m pip install .

ERROR: Could not find a version that satisfies the requirement tensorflow_io (from object-detection) (from versions: none)
ERROR: No matching distribution found for tensorflow_io

This might help https://stackoverflow.com/questions/70277737/cant-install-tensorflow-io-on-m1

phuochung commented 2 years ago

Same issue

damian0815 commented 2 years ago

Same issue, but there's another problem which has to do with protobuf versions. tensorflow-macos==2.9.2 (latest) and tensorboard 2.9.1 both want protobuf<3.20,>=3.9.2, but protobuf.internal.builder (needed to run object_detection/builders/model_builder_tf2_test.py and I guess other things too) does not exist in protobuf 3.19.

Forcing the upgrade past protobuf 3.20 causes this error:

(tensorflow-object-detection-api) damian@d-mba2 research % python object_detection/builders/model_builder_tf2_test.py
Traceback (most recent call last):
  File "object_detection/builders/model_builder_tf2_test.py", line 21, in <module>
    import tensorflow.compat.v1 as tf
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/python/__init__.py", line 37, in <module>
    from tensorflow.python.eager import context
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/python/eager/context.py", line 29, in <module>
    from tensorflow.core.framework import function_pb2
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/core/framework/function_pb2.py", line 16, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/core/framework/attr_value_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/core/framework/tensor_pb2.py", line 16, in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/core/framework/resource_handle_pb2.py", line 16, in <module>
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/tensorflow/core/framework/tensor_shape_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "/Users/damian/miniforge3/envs/tensorflow-object-detection-api/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 560, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Rebuilding protos by doing protoc object_detection/protos/*.proto --python_out=. as in this guide does not make the issue go away.

The workaround here is awful - manually copy builder.py from a more recent installation of protobuf into <env>/lib/python3.8/site-packages/google/protobuf/internal/ - but it works.

Would be good to not have to do this!

aino-gautam commented 1 year ago

Is there support for tensorflow objection detection on Mac M1 / M2 ?

I am getting this error -

ERROR: Could not find a version that satisfies the requirement tensorflow_io (from object-detection) (from versions: none) ERROR: No matching distribution found for tensorflow_io