Skip to content

Deprecation Warnings #682

@adamjstewart

Description

@adamjstewart

Describe the bug

tensorboardX is using deprecated features of protobuf. This requires every project that indirectly depends on protobuf to add the following hack to their pyproject.toml: #654.

Minimal runnable code to reproduce the behavior

$ python -Werror -c 'import tensorboardX'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/__init__.py", line 5, in <module>
    from .torchvis import TorchVis
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/torchvis.py", line 10, in <module>
    from .writer import SummaryWriter
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/writer.py", line 16, in <module>
    from .comet_utils import CometLogger
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/comet_utils.py", line 7, in <module>
    from .summary import _clean_tag
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/summary.py", line 12, in <module>
    from .proto.summary_pb2 import Summary
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/proto/summary_pb2.py", line 16, in <module>
    from tensorboardX.proto import tensor_pb2 as tensorboardX_dot_proto_dot_tensor__pb2
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/proto/tensor_pb2.py", line 16, in <module>
    from tensorboardX.proto import resource_handle_pb2 as tensorboardX_dot_proto_dot_resource__handle__pb2
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/tensorboardX/proto/resource_handle_pb2.py", line 18, in <module>
    DESCRIPTOR = _descriptor.FileDescriptor(
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 1034, in __init__
    _Deprecated('FileDescriptor')
  File "/Users/Adam/.spack/.spack-env/view/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 97, in _Deprecated
    warnings.warn(
DeprecationWarning: Call to deprecated create function FileDescriptor(). Note: Create unlinked descriptors is going to go away. Please use get/find descriptors from generated code or query the descriptor_pool.

Expected behavior

I would not expect tensorboardX to use deprecated features.

Screenshots

N/A

Environment

$ pip list|grep -E "torch|proto|tensor"
efficientnet-pytorch          0.7.1
protobuf                      3.20.1
pytorch-lightning             1.8.5
pytorch-sphinx-theme          0.0.24
segmentation-models-pytorch   0.3.1
tensorboardX                  2.5.1
torch                         1.13.1
torchmetrics                  0.11.0
torchvision                   0.14.1

Python environment

Python 3.10.8, Spack Environment

Additional context

This issue was first reported in #653 and ignored in #654. The correct solution is to not use deprecated features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions