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

Pinned protobuf version leads to dependency conflict with tensorflow>=2.13 and gRPC on M1/M2 #2261

Open
Zahlii opened this issue Oct 27, 2023 · 10 comments
Labels
enhancement New feature or request pending on user response Waiting for more information or validation from user

Comments

@Zahlii
Copy link

Zahlii commented Oct 27, 2023

tf2onnx>=1.15 pins protobuf~=3.20.2.
Tensorflow >=2.13 requires tf2onnx >= 1.15 due to #2215

In order to use gRPC natively with M1/M2 chips, we need at least grpcio>=1.51.3, which in turn requires protobuf>=4.x

As a result, I can NOT use tensorflow in combination with gRPC on M1/m2, as long as I need tensorflow >= 2.13.

Could we simply unpin the protobuf version in setup.py?

See also #2243

@Zahlii Zahlii added the enhancement New feature or request label Oct 27, 2023
@fatcat-z
Copy link
Collaborator

Could you please try to reinstall protobuf to a 4.x version after you install tf2onnx successfully? It might work as well.

IIRC, keeping 3.20.2 is for support tensorflow older version.

@fatcat-z fatcat-z added the pending on user response Waiting for more information or validation from user label Oct 27, 2023
@Zahlii
Copy link
Author

Zahlii commented Oct 30, 2023

For my use case, all tests seem to run through (I slightly changed the order, I first install everything including tf2onnx 1.14, then run a update with --no-deps for tf2onnx). However, I am building a library that will be installed by others internally, and I'd rather not have to ask every colleague to manually upgrade tf2onnx after having installed the library.

@Zahlii
Copy link
Author

Zahlii commented Oct 30, 2023

Actually, it seems there is another issue, starting with 2.14 (?) of tensorflow. Flatbuffers changed their version format from 2.xxx to 22.xxx, and tf2onnx seems to be incompatible with newer versions.

186.9 The conflict is caused by:
186.9 tensorflow 2.14.0 depends on flatbuffers>=23.5.26
186.9 tf2onnx 1.14.0 depends on flatbuffers<3.0 and >=1.12

@Zahlii
Copy link
Author

Zahlii commented Oct 30, 2023

197.7 The conflict is caused by:
197.7 tensorflow 2.13.0 depends on flatbuffers>=23.1.21
197.7 tf2onnx 1.14.0 depends on flatbuffers<3.0 and >=1.12

@Ganga-Yadav
Copy link

Could you please try to reinstall protobuf to a 4.x version after you install tf2onnx successfully? It might work as well.

IIRC, keeping 3.20.2 is for support tensorflow older version.

i used :
Name: protobuf
Version: 4.25.1 with tensorflow Version: 2.13 but it didn't work ..

@fatcat-z
Copy link
Collaborator

fatcat-z commented Jan 3, 2024

197.7 The conflict is caused by: 197.7 tensorflow 2.13.0 depends on flatbuffers>=23.1.21 197.7 tf2onnx 1.14.0 depends on flatbuffers<3.0 and >=1.12

Starts from tf2onnx 1.15.0, flatbuffers is not required to be <3.0.

@fatcat-z
Copy link
Collaborator

fatcat-z commented Jan 3, 2024

Could you please try to reinstall protobuf to a 4.x version after you install tf2onnx successfully? It might work as well.
IIRC, keeping 3.20.2 is for support tensorflow older version.

i used : Name: protobuf Version: 4.25.1 with tensorflow Version: 2.13 but it didn't work ..

Could you please share more details about your scenario which doesn't work?

@hmc-cs-mdrissi
Copy link

IIRC, keeping 3.20.2 is for support tensorflow older version.

Older tf versions already have constraint blocking protobuf<4. Adding constraint for older version of another package mostly introduces dependency conflicts and pushes towards vendoring the library/re-packaging it entirely. Especially as pip ecosystem lacks a good mechanism for overrides so I'd also find it helpful if constraint is dropped.

@harshad16
Copy link

I agree with @hmc-cs-mdrissi insight, the pinned protobuf is causing issue with other python modules, which requires protobuf > 4 . Can the pinned version be dropped form tf2onnx?

@fatcat-z
Copy link
Collaborator

I agree with @hmc-cs-mdrissi insight, the pinned protobuf is causing issue with other python modules, which requires protobuf > 4 . Can the pinned version be dropped form tf2onnx?

Thanks for your comments..

At this moment, tf2onnx is still designed to support older tf versions as many as possible and some of them could not work on a version above 3.20.x. In addition, couple of dependencies of tf2onnx also required the protobuf version ~= 3.20.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pending on user response Waiting for more information or validation from user
Projects
None yet
Development

No branches or pull requests

5 participants