Skip to content

PR CI builds failure due to incompatibility of recent protobuf with pytorch #4945

@Jmennius

Description

@Jmennius

Recent CI PR builds are failing due to incompatibility of recent protobuf (Python protobuf 4.*) with proto files in pytorch.
Previously, tensorboard was the one to constrain protobuf to <4, but since tensorflow/tensorboard#6147 was merged (released with 2.12.0) - it supports protobuf 4.* and version specifier is relaxed to include 4.*.

Change announcement in protobuf.

Environment

detectron2 PR CI

Full logs or other relevant observations

Occurs in #4938.

error log from CI
============================= test session starts ==============================
platform linux -- Python 3.8.6, pytest-7.3.1, pluggy-1.0.0 -- /opt/circleci/.pyenv/versions/3.8.6/bin/python3.8
cachedir: .pytest_cache
rootdir: /home/circleci/detectron2
plugins: hydra-core-1.3.2
collecting ... 
collecting 15 items                                                            
collecting 56 items / 4 errors                                                 
collected 297 items / 6 errors                                                 

==================================== ERRORS ====================================
_________________ ERROR collecting tests/test_export_caffe2.py _________________
tests/test_export_caffe2.py:18: in <module>
    from detectron2.export import Caffe2Model, Caffe2Tracer
detectron2/export/__init__.py:9: in <module>
    from caffe2.proto import caffe2_pb2 as _tmp
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/__init__.py:11: in <module>
    from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/caffe2_pb2.py:33: in <module>
    _descriptor.EnumValueDescriptor(
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/google/protobuf/descriptor.py:796: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   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.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E   
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
__________________ ERROR collecting tests/test_export_onnx.py __________________
tests/test_export_onnx.py:11: in <module>
    from detectron2.export import STABLE_ONNX_OPSET_VERSION
detectron2/export/__init__.py:9: in <module>
    from caffe2.proto import caffe2_pb2 as _tmp
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/__init__.py:11: in <module>
    from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/caffe2_pb2.py:33: in <module>
    _descriptor.EnumValueDescriptor(
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/google/protobuf/descriptor.py:796: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   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.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E   
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
______________ ERROR collecting tests/test_export_torchscript.py _______________
tests/test_export_torchscript.py:17: in <module>
    from detectron2.export import dump_torchscript_IR, scripting_with_instances
detectron2/export/__init__.py:9: in <module>
    from caffe2.proto import caffe2_pb2 as _tmp
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/__init__.py:11: in <module>
    from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/caffe2_pb2.py:33: in <module>
    _descriptor.EnumValueDescriptor(
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/google/protobuf/descriptor.py:796: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   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.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E   
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
________________ ERROR collecting tests/test_model_analysis.py _________________
tests/test_model_analysis.py:8: in <module>
    from detectron2.utils.analysis import find_unused_parameters, flop_count_operators, parameter_count
detectron2/utils/analysis.py:10: in <module>
    from detectron2.export import TracingAdapter
detectron2/export/__init__.py:9: in <module>
    from caffe2.proto import caffe2_pb2 as _tmp
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/__init__.py:11: in <module>
    from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/caffe2_pb2.py:33: in <module>
    _descriptor.EnumValueDescriptor(
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/google/protobuf/descriptor.py:796: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   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.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E   
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
__________________ ERROR collecting tests/export/test_c10.py ___________________
tests/export/test_c10.py:8: in <module>
    from detectron2.export.c10 import Caffe2RPN
detectron2/export/__init__.py:9: in <module>
    from caffe2.proto import caffe2_pb2 as _tmp
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/__init__.py:11: in <module>
    from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/caffe2_pb2.py:33: in <module>
    _descriptor.EnumValueDescriptor(
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/google/protobuf/descriptor.py:796: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   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.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E   
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
_________________ ERROR collecting tests/modeling/test_rpn.py __________________
tests/modeling/test_rpn.py:7: in <module>
    from detectron2.export import scripting_with_instances
detectron2/export/__init__.py:9: in <module>
    from caffe2.proto import caffe2_pb2 as _tmp
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/__init__.py:11: in <module>
    from caffe2.proto import caffe2_pb2, metanet_pb2, torch_pb2
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/caffe2/proto/caffe2_pb2.py:33: in <module>
    _descriptor.EnumValueDescriptor(
/opt/circleci/.pyenv/versions/3.8.6/lib/python3.8/site-packages/google/protobuf/descriptor.py:796: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot not be created directly.
E   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.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E   
E   More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
=============================== warnings summary ===============================
detectron2/data/transforms/transform.py:46
  /home/circleci/detectron2/detectron2/data/transforms/transform.py:46: DeprecationWarning: LINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use BILINEAR or Resampling.BILINEAR instead.
    def __init__(self, src_rect, output_size, interp=Image.LINEAR, fill=0):

tests/config/test_instantiate_config.py:18
  /home/circleci/detectron2/tests/config/test_instantiate_config.py:18: PytestCollectionWarning: cannot collect test class 'TestClass' because it has a __init__ constructor (from: tests/config/test_instantiate_config.py)
    class TestClass:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/test_export_caffe2.py - TypeError: Descriptors cannot not 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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
ERROR tests/test_export_onnx.py - TypeError: Descriptors cannot not 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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
ERROR tests/test_export_torchscript.py - TypeError: Descriptors cannot not 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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
ERROR tests/test_model_analysis.py - TypeError: Descriptors cannot not 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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
ERROR tests/export/test_c10.py - TypeError: Descriptors cannot not 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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
ERROR tests/modeling/test_rpn.py - TypeError: Descriptors cannot not 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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
!!!!!!!!!!!!!!!!!!! Interrupted: 6 errors during collection !!!!!!!!!!!!!!!!!!!!
======================== 2 warnings, 6 errors in 2.79s =========================

Exited with code exit status 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions