-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
import error with protobuf==4.21.0 #13159
Comments
Could be related to this - protocolbuffers/protobuf#10051 |
It seems so. For anyone seeing this issue, a quick workaround is to downgrade
EDIT on June 9, 2022:
|
This is an issue with tensorboard, not with pytorch-lightning, correct? Can someone open an issue with tensorboard? |
Tensorboard devs have pinned protobuf - tensorflow/tensorboard@fd4f5ff |
(To protect our CI from errors like this for stability, ) This issue is not something we could've avoided with our current dependency freezing logic using dependabot because Lightning doesn't have a direct dependency to |
Quickly checked our CI jobs and saw a few failures due to this issue, but they all seem to work fine now possibly because |
The reason CI works now is that protobuf yanked the latest release from PyPI: https://pypi.org/project/protobuf/#history. Once another release comes out things will break again unless tensorboard has a new release that contains the pin. |
@adamjstewart Thank you very much for the information! I'll keep this issue open so that we do something before it breaks our CI again. |
https://app.circleci.com/pipelines/github/pytorch/audio/10979/workflows/42005226-ca7e-471c-80f4-db09f4bd2089/jobs/692078 ``` 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 ``` protocolbuffers/protobuf#10051 Lightning-AI/pytorch-lightning#13159
https://app.circleci.com/pipelines/github/pytorch/audio/10979/workflows/42005226-ca7e-471c-80f4-db09f4bd2089/jobs/692078 ``` 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 ``` protocolbuffers/protobuf#10051 Lightning-AI/pytorch-lightning#13159
Summary: All the unittests jobs are failing due to import error due to protobuf and scipy. This commit pins the versions of them to an older version. ## protobuf https://app.circleci.com/pipelines/github/pytorch/audio/10979/workflows/42005226-ca7e-471c-80f4-db09f4bd2089/jobs/692078 ``` 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 ``` protocolbuffers/protobuf#10051 Lightning-AI/pytorch-lightning#13159 ## scipy (pypocketfft) 1.8.1 is causing issue. https://app.circleci.com/pipelines/github/pytorch/audio/10980/workflows/470a9361-4cc5-4d7c-9264-28fc8b86f1cb/jobs/692267 ``` ../env/lib/python3.9/site-packages/librosa/core/audio.py:11: in <module> import scipy.signal ../env/lib/python3.9/site-packages/scipy/signal/__init__.py:309: in <module> from . import _sigtools, windows ../env/lib/python3.9/site-packages/scipy/signal/windows/__init__.py:41: in <module> from ._windows import * ../env/lib/python3.9/site-packages/scipy/signal/windows/_windows.py:7: in <module> from scipy import linalg, special, fft as sp_fft ../env/lib/python3.9/site-packages/scipy/fft/__init__.py:91: in <module> from ._helper import next_fast_len ../env/lib/python3.9/site-packages/scipy/fft/_helper.py:3: in <module> from ._pocketfft import helper as _helper ../env/lib/python3.9/site-packages/scipy/fft/_pocketfft/__init__.py:3: in <module> from .basic import * ../env/lib/python3.9/site-packages/scipy/fft/_pocketfft/basic.py:6: in <module> from . import pypocketfft as pfft E ImportError: /home/circleci/project/env/lib/python3.9/site-packages/torch/lib/../../../.././libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /home/circleci/project/env/lib/python3.9/site-packages/scipy/fft/_pocketfft/pypocketfft.cpython-39-x86_64-linux-gnu.so) Pull Request resolved: #2422 Reviewed By: atalman Differential Revision: D36764198 Pulled By: mthrok fbshipit-source-id: 897a79fe9c3165206c2e747147fd0f257fc4f683
Summary: It fails at importing pytorch_lightning. This issue is caused by protobuf and fixed in lightning by pinning "protobuf<=3.20.1": Lightning-AI/pytorch-lightning#13159 Reproduce: (recipes) ➜ python dlrm_main.py Traceback (most recent call last): File "dlrm_main.py", line 14, in <module> import pytorch_lightning as pl File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/__init__.py", line 30, in <module> from pytorch_lightning.callbacks import Callback # noqa: E402 File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/callbacks/__init__.py", line 26, in <module> from pytorch_lightning.callbacks.pruning import ModelPruning File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/callbacks/pruning.py", line 31, in <module> from pytorch_lightning.core.lightning import LightningModule File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/core/__init__.py", line 16, in <module> from pytorch_lightning.core.lightning import LightningModule File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/core/lightning.py", line 40, in <module> from pytorch_lightning.loggers import LightningLoggerBase File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/loggers/__init__.py", line 18, in <module> from pytorch_lightning.loggers.tensorboard import TensorBoardLogger File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/pytorch_lightning/loggers/tensorboard.py", line 26, in <module> from torch.utils.tensorboard import SummaryWriter File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/torch/utils/tensorboard/__init__.py", line 10, in <module> from .writer import FileWriter, SummaryWriter # noqa: F401 File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/torch/utils/tensorboard/writer.py", line 9, in <module> from tensorboard.compat.proto.event_pb2 import SessionLog File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/tensorboard/compat/proto/event_pb2.py", line 17, in <module> from tensorboard.compat.proto import summary_pb2 as tensorboard_dot_compat_dot_proto_dot_summary__pb2 File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/tensorboard/compat/proto/summary_pb2.py", line 17, in <module> from tensorboard.compat.proto import tensor_pb2 as tensorboard_dot_compat_dot_proto_dot_tensor__pb2 File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/tensorboard/compat/proto/tensor_pb2.py", line 16, in <module> from tensorboard.compat.proto import resource_handle_pb2 as tensorboard_dot_compat_dot_proto_dot_resource__handle__pb2 File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/tensorboard/compat/proto/resource_handle_pb2.py", line 16, in <module> from tensorboard.compat.proto import tensor_shape_pb2 as tensorboard_dot_compat_dot_proto_dot_tensor__shape__pb2 File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/tensorboard/compat/proto/tensor_shape_pb2.py", line 42, in <module> serialized_options=None, file=DESCRIPTOR), File "/Users/stevenliu/opt/anaconda3/envs/recipes/lib/python3.7/site-packages/google/protobuf/descriptor.py", line 560, in __new__ _message.Message._CheckCalledFromGeneratedFile() 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 Reviewed By: colin2328 Differential Revision: D36875536 fbshipit-source-id: 0233696282b1f49dd0e061024e6ddb965df1d8df
Thank You so much. |
🐛 Bug
import error when using new protobuf version
To Reproduce
pip install pytorch_lightning protobuf
python
Results
Expected behavior
No import error
Environment
python:3.9-slim
conda
,pip
, source): piptorch.__config__.show()
:Additional context
Filed on this github action
cc @tchaton @rohitgr7
The text was updated successfully, but these errors were encountered: