Tensorflow Object Detection Api M1 Macbook Conflict Error
Solution 1:
I successfully install it with.
python -m pip install --force--no-dependencies .
My list of commands for install correctly tf2.0 for m1
conda create —-name=tf-m1
conda activate tf-m1
conda install python=3.8.6 -y
sh Desktop/PATH TO GITHUB DIR OF TENSORFLOW MAC(i used 0.1a3)/install_venv.sh /Users/stefan/miniforge3/envs/tf-m1
python -m pip install --upgrade pip
pip install ipykernel jupyter
python -m ipykernel install --user --name=tensorflow-m1.0
Tensorflow Test : ok (import tensorflow as tf; print(tf.__version__))
NOW USE CONDA INSTALL
conda install -c conda-forge matplotlib -y
conda install -c conda-forge scikit-learn -y
conda install -c conda-forge opencv -y
conda install -c conda-forge pandas -y
Tensorflow Test : ok
cd Desktop/PATH/
mkdir -p Tensorflow/models
git clone https://github.com/tensorflow/models Tensorflow/models
cd Tensorflow/models/research && protoc object_detection/protos/*.proto --python_out=. && cp object_detection/packages/tf2/setup.py . && python -m pip install --force --no-dependencies .
Object detection api have some dependencies i had installed. (Pyarrow and apache-beam are not supported at the moment, but I think this isn't essential for general working of api)
pip install tf-slim
pip install pycocotools
pip install lxml
pip install lvis
pip install contextlib2
pip install --no-dependencies tf-models-official
pip install avro-python3
pip install pyyaml
Pip install gin-config
I don't know if is it the perfect installation of Tensorflow and TensorFlow object-detection-api, but at the moment this worked for me.
Solution 2:
I have the same issue installing the Object Detection API for Tensorflow 2 (OD API) from sources on my MacBook Air M1 2020. It starts to lookup/download all available dependencies with very long errors and after several hours the process drains all available RAM and forces the laptop to reboot. I think the problem is with incompatible dependencies for arm64. I tried to build/install OD API for Tensorflow 1 instead and it worked! I successfully trained a model with TensorFlow 2 and GPU enabled.
Use the tf1
folder when you installing the OD API instead of tf2
:
cd models/research
# Compile protos.
protoc object_detection/protos/*.proto --python_out=.
# Install TensorFlow Object Detection API.cp object_detection/packages/tf1/setup.py .
python -m pip install --use-feature=2020-resolver .
or just use this guide for installing OD API: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/tf1.md
By the way,
- here is a working Tensorflow setup on Apple M1 silicon with the latest TensorFlow versions and Metal GPU acceleration: https://github.com/ctrahey/m1-tensorflow-config
- the best guide for object detection: https://neptune.ai/blog/how-to-train-your-own-object-detector-using-tensorflow-object-detection-api
Solution 3:
Things should work better if you upgrade to OS Monterey and install conda from miniforge and the packages listed below.
As of Oct. 25, 2021 macOS 12 Monterey is generally available.
Upgrade your machine to Monterey.
If you have conda installed, uninstall it.
Then follow the instructions from Apple here.
Cleaned up below:
Download and install Conda from Miniforge:
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
In a conda environment, install the TensorFlow dependencies, base TensorFlow, and TensorFlow metal:
conda install -c apple tensorflow-deps
pip install tensorflow-macos
pip install tensorflow-metal
You should be good to go.
Post a Comment for "Tensorflow Object Detection Api M1 Macbook Conflict Error"