Coder Social home page Coder Social logo

PPQ installtion error: `TypeError: Descriptors cannot be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.` about ppq HOT 5 OPEN

kyrie2to11 avatar kyrie2to11 commented on May 28, 2024
PPQ installtion error: `TypeError: Descriptors cannot be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.`

from ppq.

Comments (5)

ZhangZhiPku avatar ZhangZhiPku commented on May 28, 2024 1

出现上述问题的原因是PPQ在过去支持过很多公司内部的 caffe 模型,这些 caffe 模型历史久远,它们使用 protobuf3 进行序列化。
因此 PPQ 的 caffe_exporter 需要引用 protobuf3。

解决问题的方法很简单,您注意到报错位于
File "/home/jarvis/Projects/ppq/ppq/parser/caffe_exporter.py", line 15, in
from .caffe import ppl_caffe_pb2

请将其直接修改成

try:
    from .caffe import ppl_caffe_pb2
except Exception as e:
    pass

上述修改将直接屏蔽掉 protobuf3 的引用,它只在导出 caffe model 时起作用,在下一个 ppq 的版本中我们也将如此更新。

from ppq.

zhangcheng030970 avatar zhangcheng030970 commented on May 28, 2024

image

from ppq.

zhangcheng030970 avatar zhangcheng030970 commented on May 28, 2024

修改后任然报错

from ppq.

zhangcheng030970 avatar zhangcheng030970 commented on May 28, 2024

出现上述问题的原因是PPQ在过去支持过很多公司内部的 caffe 模型,这些 caffe 模型历史久远,它们使用 protobuf3 进行序列化。 因此 PPQ 的 caffe_exporter 需要引用 protobuf3。

解决问题的方法很简单,您注意到报错位于 File "/home/jarvis/Projects/ppq/ppq/parser/caffe_exporter.py", line 15, in from .caffe import ppl_caffe_pb2

请将其直接修改成

try:
    from .caffe import ppl_caffe_pb2
except Exception as e:
    pass

上述修改将直接屏蔽掉 protobuf3 的引用,它只在导出 caffe model 时起作用,在下一个 ppq 的版本中我们也将如此更新。

image

from ppq.

J-xinyu avatar J-xinyu commented on May 28, 2024

you need a lower vesion of onnx.
it works for me pip install onnx==1.13.0

from ppq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.