paddlecls安装requirement.txt环境,存在protobuf报错

flseospp  于 2个月前  发布在  其他
关注(0)|答案(5)|浏览(43)

bug描述 Describe the Bug

在paddleclas中安装pip install -r requirements.txt,报错如下:
........
Attempting uninstall: protobuf
Found existing installation: protobuf 3.20.0
Uninstalling protobuf-3.20.0:
Successfully uninstalled protobuf-3.20.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
paddlepaddle-gpu 2.4.2.post117 requires protobuf<=3.20.0,>=3.1.0, but you have protobuf 3.20.3 which is incompatible.
Successfully installed Babel-2.12.1 Flask-Babel-3.1.0 Jinja2-3.1.2 PyYAML-6.0 Werkzeug-2.2.3 aiofiles-23.1.0 aiohttp-3.8.4 aiosignal-1.3.1 altair-4.2.2 anyio-3.6.2 async-timeout-4.0.2 attrdict-2.0.1 attrs-22.2.0 bce-python-sdk-0.8.83 brotli-1.0.9 click-8.1.3 contourpy-1.0.7 cycler-0.11.0 easydict-1.10 entrypoints-0.4 faiss-cpu-1.7.3 fastapi-0.95.0 ffmpy-0.3.0 filelock-3.11.0 flask-2.2.3 fonttools-4.39.3 frozenlist-1.3.3 fsspec-2023.4.0 future-0.18.3 gast-0.3.3 gevent-22.10.2 geventhttpclient-2.0.2 gradio-3.25.0 gradio-client-0.0.10 greenlet-2.0.2 grpcio-1.53.0 h11-0.14.0 httpcore-0.17.0 httpx-0.24.0 huggingface-hub-0.13.4 importlib-metadata-6.3.0 importlib-resources-5.12.0 itsdangerous-2.1.2 joblib-1.2.0 jsonschema-4.17.3 kiwisolver-1.4.4 linkify-it-py-2.0.0 markdown-it-py-2.2.0 markupsafe-2.1.2 matplotlib-3.7.1 mdit-py-plugins-0.3.3 mdurl-0.1.2 mpmath-1.3.0 multidict-6.0.4 onnx-1.13.1 opencv-python-4.6.0.66 orjson-3.8.10 packaging-23.0 pandas-2.0.0 pkgutil-resolve-name-1.3.10 prettytable-3.7.0 protobuf-3.20.3 psutil-5.9.4 pycryptodome-3.17 pydantic-1.10.7 pydub-0.25.1 pyparsing-3.0.9 pyrsistent-0.19.3 python-dateutil-2.8.2 python-multipart-0.0.6 python-rapidjson-1.10 pytz-2023.3 rarfile-4.0 scikit-learn-1.2.2 scipy-1.10.1 semantic-version-2.10.0 sniffio-1.3.0 starlette-0.26.1 sympy-1.11.1 threadpoolctl-3.1.0 toolz-0.12.0 tqdm-4.65.0 tritonclient-2.32.0 typing-extensions-4.5.0 tzdata-2023.3 uc-micro-py-1.0.1 ujson-5.7.0 uvicorn-0.21.1 visualdl-2.5.1 wcwidth-0.2.6 websockets-11.0.1 x2paddle-1.4.1 yarl-1.8.2 zipp-3.15.0 zope.event-4.6 zope.interface-6.0

因此,我pip install protobuf==3.20.0之后,又报错。如下:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting protobuf==3.20.0
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/88/88/cd55f87e896b82a3aba8e6c0affc077de51f7321cf730622b17ef7b0f69c/protobuf-3.20.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
Installing collected packages: protobuf
Attempting uninstall: protobuf
Found existing installation: protobuf 3.20.3
Uninstalling protobuf-3.20.3:
Successfully uninstalled protobuf-3.20.3
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
onnx 1.13.1 requires protobuf<4,>=3.20.2, but you have protobuf 3.20.0 which is incompatible.
Successfully installed protobuf-3.20.0

其他补充信息 Additional Supplementary Information

请问到底如何不冲突protobuf

atmip9wb

atmip9wb1#

看起来是onnx和paddle对protobuf的版本要求有冲突,你这边是需要使用onnx么?以及对onnx的版本有要求么?

1wnzp6jl

1wnzp6jl2#

看起来是onnx和paddle对protobuf的版本要求有冲突,你这边是需要使用onnx么?以及对onnx的版本有要求么?

你们自家的 PaddleDetection / PaddleCLS / FastDeploy / PaddleSlim / PaddleNLP 这些套件应该都会用到,具体的 onnx 版本可以咨询一下你们内部做这些套件的同学,比如安装 PaddleDetection 的依赖,就有同样的问题,建议升级一下 protobuf 版本,至少保证你们自家的套件安装不报错

eni9jsuy

eni9jsuy3#

看起来是onnx和paddle对protobuf的版本要求有冲突,你这边是需要使用onnx么?以及对onnx的版本有要求么?

你们自家的 PaddleDetection / PaddleCLS / FastDeploy / PaddleSlim / PaddleNLP 这些套件应该都会用到,具体的 onnx 版本可以咨询一下你们内部做这些套件的同学,比如安装 PaddleDetection 的依赖,就有同样的问题,建议升级一下 protobuf 版本,至少保证你们自家的套件安装不报错

安装ONNX 1.12.0 Protobuf 3.20.0倒是可以,不过版本太旧了,按着官方教程装能和自己家的其他套件报依赖冲突问题就很离谱

fcy6dtqo

fcy6dtqo4#

同遇到这种情况,tensorflow 的cpu包和gpu包都提示我protobuf版本过高,但是安装好了低版本的protobuf之后,又出现了别的包说protobuf版本过低

相关问题