Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install object detection on M1 Mac #13

Closed
AnasAr96 opened this issue Jan 15, 2023 · 4 comments
Closed

Can't install object detection on M1 Mac #13

AnasAr96 opened this issue Jan 15, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@AnasAr96
Copy link
Collaborator

From within TensorFlow/models/research/

cp object_detection/packages/tf2/setup.py .
python -m pip install --use-feature=2020-resolver .

ERROR: Cannot install object-detection because these package versions have conflicting dependencies.

The conflict is caused by:
tf-models-official 2.11.2 depends on tensorflow-text~=2.11.0
tf-models-official 2.11.0 depends on opencv-python-headless==4.5.2.52
tf-models-official 2.10.1 depends on tensorflow-text~=2.10.0
tf-models-official 2.10.0 depends on opencv-python-headless==4.5.2.52
tf-models-official 2.9.2 depends on tensorflow~=2.9.0
tf-models-official 2.9.1 depends on tensorflow~=2.9.0
tf-models-official 2.9.0 depends on tensorflow~=2.9.0
tf-models-official 2.8.0 depends on tensorflow~=2.8.0
tf-models-official 2.7.2 depends on tensorflow-text>=2.4.0
tf-models-official 2.7.1 depends on tensorflow-text>=2.4.0
tf-models-official 2.7.0 depends on tensorflow>=2.7.0
tf-models-official 2.6.1 depends on tensorflow-text>=2.6.0
tf-models-official 2.6.0 depends on tensorflow>=2.5.0
tf-models-official 2.5.1 depends on tensorflow>=2.5.0

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict
@AnasAr96
Copy link
Collaborator Author

we get dependency problems because we have tensorflow-macos and not the normal tensorflow.
pleas ignore the part "--use-feature=2020-resolver"

To solve the dependency problems, just use the pip command "-no-deps" and type this:

python -m pip install . --no-deps

@AnasAr96
Copy link
Collaborator Author

After a long research I found out that object-detection from tf2 is not compatible on M1 Macs.

but the old version of tf1 would also work without problems.

change your installation to be like:
-From within TensorFlow/models/research/

cp object_detection/packages/tf1/setup.py .
python -m pip install . -no-deps

@AnasAr96
Copy link
Collaborator Author

AnasAr96 commented Jan 15, 2023

After that you will face a problem with protoc.
if you installed any protoc package just uninstall them and do the following:

pip install protobuf==3.9.2
go to your installation directory. If you use condo you will finde it under:
PATH_TO_YOUR_CONDA_DIR/envs/YOUR_ENV/lib/python3.9/site-packages/google/protobuf/internal

copy the file "builder.py" to another directory e.g. Desktop

now install the other protoc

pip install protobuf==3.19.4

and then copy the "builder.py" to the same dir
PATH_TO_YOUR_CONDA_DIR/envs/YOUR_ENV/lib/python3.9/site-packages/google/protobuf/internal

@AnasAr96
Copy link
Collaborator Author

AnasAr96 commented Jan 15, 2023

to finish the installation you also need this packages:

pip install tf-models-official --no-deps
pip install pyyaml==5.3 --no-deps
pip install gin-config==0.1.1 --no-deps
pip install tensorflow-addons==0.16.1 --no-deps
pip install typeguard== 2.13.3 --no-deps

@AnasAr96 AnasAr96 added the bug Something isn't working label Jan 15, 2023
@AnasAr96 AnasAr96 self-assigned this Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant