Giter Site home page Giter Site logo

Comments (4)

rok-povsic avatar rok-povsic commented on June 8, 2024 1

@lftalkington Hi, a Protobuf version 3.7.0 was released just today which is the reason for this error. We're looking into how to fix this. At this moment, you can manually install the previous version with pip install protobuf==3.6.1.

from clarifai-python.

chrisbolman avatar chrisbolman commented on June 8, 2024 1

thanks @rok-povsic, one of our engineers just ran into this too. appreciate the suggestion.

from clarifai-python.

k-dal avatar k-dal commented on June 8, 2024 1

@chrisbolman I just encountered the same issue. Downgrading to protobuf==3.6.1 didn't do it for me due to another library's dependency, but I was able to get ClarifaiApp() working again by overriding the __init__() method in _CustomParser to match the older version of protobuf.

class _CustomParser(_Parser):

  def __init__(self, ignore_unknown_fields):
    """
    Overriding the super class init. More details here:
    https://github.com/Clarifai/clarifai-python/issues/101
    """
    self.ignore_unknown_fields = ignore_unknown_fields

  def _ConvertFieldValuePair(self, js, message):
    """
    Because of fields with custom extensions such as cl_default_float, we need
    to adjust the original's method's JSON object parameter by setting them explicitly to the
    default value.
    """

    message_descriptor = message.DESCRIPTOR
    for f in message_descriptor.fields:
      default_float = f.GetOptions().Extensions[extensions_pb2.cl_default_float]
      if default_float:
        if f.name not in js:
          js[f.name] = default_float

    super(_CustomParser, self)._ConvertFieldValuePair(js, message)

_CustomParser is here: clarifai/rest/grpc/custom_converters/custom_dict_to_message.py

Hope this helps others.

from clarifai-python.

rok-povsic avatar rok-povsic commented on June 8, 2024 1

@lftalkington @chrisbolman @kevindalias We've just released the version which has the Protobuf 3.7.0 support. Please upgrade to the latest Clarifai version with: pip install clarifai --upgrade. Workaround are no longer needed.

Thanks a lot for reporting this. Please let us know if you encounter any more issues.

from clarifai-python.

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.