首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tensorflow对象检测Api M1 Macbook冲突错误

Tensorflow对象检测Api M1 Macbook冲突错误
EN

Stack Overflow用户
提问于 2021-08-26 20:42:43
回答 3查看 2.9K关注 0票数 3

机器:MacBook Air M1 2020

操作系统:macOs BigSur 11.4

Python:Python3.8.6

Tensorflow版本:ATF苹果Tensorflow 0.1a3

Pip版本:21.2.4

我已经使用github使用本指南安装了Tensorflow。

现在,我的清单是这个。

代码语言:javascript
复制
Package                 Version
----------------------- ---------
absl-py                 0.13.0
appnope                 0.1.2
astunparse              1.6.3
backcall                0.2.0
cached-property         1.5.2
cachetools              4.2.2
certifi                 2021.5.30
charset-normalizer      2.0.4
cycler                  0.10.0
Cython                  0.29.24
debugpy                 1.4.1
decorator               5.0.9
entrypoints             0.3
flatbuffers             2.0
gast                    0.5.2
google-auth             1.35.0
google-auth-oauthlib    0.4.5
google-pasta            0.2.0
grpcio                  1.33.2
h5py                    2.10.0
idna                    3.2
ipykernel               6.2.0
ipython                 7.26.0
ipython-genutils        0.2.0
jedi                    0.18.0
jupyter-client          7.0.1
jupyter-core            4.7.1
Keras-Preprocessing     1.1.2
kiwisolver              1.3.1
Markdown                3.3.4
matplotlib              3.4.3
matplotlib-inline       0.1.2
nest-asyncio            1.5.1
numpy                   1.18.5
oauthlib                3.1.1
opt-einsum              3.3.0
packaging               21.0
parso                   0.8.2
pexpect                 4.8.0
pickleshare             0.7.5
Pillow                  8.3.1
pip                     21.2.4
prompt-toolkit          3.0.20
protobuf                3.17.3
ptyprocess              0.7.0
pyasn1                  0.4.8
pyasn1-modules          0.2.8
Pygments                2.10.0
pyparsing               2.4.7
python-dateutil         2.8.2
pyzmq                   22.2.1
requests                2.26.0
requests-oauthlib       1.3.0
rsa                     4.7.2
setuptools              57.4.0
six                     1.16.0
tensorboard             2.6.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit  1.8.0
tensorflow-addons       0.1a3
tensorflow-estimator    2.6.0
tensorflow-hub          0.12.0
tensorflow              0.1a3
termcolor               1.1.0
tornado                 6.1
traitlets               5.0.5
typeguard               2.12.1
typing-extensions       3.10.0.0
urllib3                 1.26.6
wcwidth                 0.2.5
Werkzeug                2.0.1
wheel                   0.37.0
wrapt                   1.12.1

我希望在那个链接中安装来自Tensorflow的对象检测Api。

我克隆了回购,他们我跟随指南。(Python包安装)

当我执行这个命令时

代码语言:javascript
复制
python -m pip install --use-feature=2020-resolver .

它开始下载,并开始打印非常长的错误。

在操作结束时,它给出了这个错误。

代码语言:javascript
复制
  Using cached scipy-1.2.3.tar.gz (23.3 MB)
Collecting pandas
  Using cached pandas-1.3.2-cp38-cp38-macosx_11_0_arm64.whl
Collecting tf-models-official>=2.5.1
  Using cached tf_models_official-2.6.0-py2.py3-none-any.whl (1.8 MB)
Collecting kaggle>=1.3.9
  Using cached kaggle-1.5.12-py3-none-any.whl
Collecting py-cpuinfo>=3.3.0
  Using cached py_cpuinfo-8.0.0-py3-none-any.whl
Requirement already satisfied: numpy>=1.15.4 in /Users/stefan/Desktop/Studio/TFOD/tf-m1/lib/python3.8/site-packages (from tf-models-official>=2.5.1->object-detection==0.1) (1.18.5)
Collecting opencv-python-headless
  Using cached opencv_python_headless-4.5.3.56-cp38-cp38-macosx_11_0_arm64.whl (10.7 MB)
Collecting tf-models-official>=2.5.1
  Using cached tf_models_official-2.5.1-py2.py3-none-any.whl (1.6 MB)
Collecting tensorflow-datasets
  Using cached tensorflow_datasets-4.4.0-py3-none-any.whl (4.0 MB)
Collecting google-api-python-client>=1.6.7
  Downloading google_api_python_client-2.18.0-py2.py3-none-any.whl (7.4 MB)
     |████████████████████████████████| 7.4 MB 3.4 MB/s 
Collecting oauth2client
  Using cached oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
Collecting tensorflow-model-optimization>=0.4.1
  Using cached tensorflow_model_optimization-0.6.0-py2.py3-none-any.whl (211 kB)
Collecting pyyaml>=5.1
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     |████████████████████████████████| 175 kB 31.3 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting gin-config
  Using cached gin_config-0.4.0-py2.py3-none-any.whl (46 kB)
Collecting sacrebleu
  Using cached sacrebleu-2.0.0-py3-none-any.whl (90 kB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of object-detection to determine which version is compatible with other requirements. This could take a while.
ERROR: Cannot install object-detection because these package versions have conflicting dependencies.

The conflict is caused by:
    tf-models-official 2.6.0 depends on tensorflow-text>=2.5.0
    tf-models-official 2.5.1 depends on tensorflow-addons

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

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2021-09-08 20:00:28

我成功地安装了它。

代码语言:javascript
复制
python -m pip install --force --no-dependencies . 

为m1正确安装tf2.0的命令列表

代码语言:javascript
复制
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__))

现在使用CONDA安装

代码语言:javascript
复制
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试验:好

代码语言:javascript
复制
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 . 

对象检测api有一些我已经安装的依赖项。(目前还不支持Pyarrow和apache-beam,但我认为这对api的一般工作并不重要)

代码语言:javascript
复制
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

我不知道这是否是Tensorflow和TensorFlow对象检测-api的完美安装,但目前这对我是有效的。

票数 2
EN

Stack Overflow用户

发布于 2021-09-07 09:57:16

我也有同样的问题,在我的MacBook Air M1 2020上安装Tensorflow 2对象检测API (OD )。它开始查找/下载所有有很长错误的可用依赖项,几个小时后,这个过程耗尽了所有可用的RAM,并迫使笔记本电脑重新启动。我认为问题在于arm64不兼容的依赖关系。我尝试为Tensorflow 1构建/安装OD API,但它成功了!我成功地训练了一个TensorFlow 2和GPU启用的模型。

安装OD API而不是tf2时使用tf2文件夹

代码语言:javascript
复制
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 .

或者只需使用本指南安装OD API:检测/g3doc/tf1.md

顺便说一下,

票数 0
EN

Stack Overflow用户

发布于 2021-10-29 18:58:30

如果您升级到OS蒙特雷,并安装conda从迷你锻造和下面列出的软件包,事情应该更好。

截至2021年10月25日,macOS 12蒙特利是一般可得

把你的机器升级到蒙特利。

如果您安装了conda,请卸载它。

然后按照苹果这里的说明。

清理如下:

下载并安装小型锻造公司的Conda:

代码语言:javascript
复制
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate

在conda环境中,安装TensorFlow依赖项、基本TensorFlow和TensorFlow金属:

代码语言:javascript
复制
conda install -c apple tensorflow-deps
pip install tensorflow-macos
pip install tensorflow-metal

你该走了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68945096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档