Skip to content

caffe2: Python 3 deprecation warnings about inspect.getargspec #44185

Open
@garaud

Description

@garaud

🐛 Bug

I work with a legacy code which uses caffe2. I've recently switched the code from Python 2 to Python 3. When I run pytest, it catches several deprecation warnings about inspect.getargspec. This function is not compatible with Python 3.

To Reproduce

Steps to reproduce the behavior:

  • This is the class HelperWrapper which is used.
  • The legacy code is inspired from an old version of detectron
  • When I carry out a prediction with a faster_rcnn model, I've got the following message:
venv/python3.6/site-packages/caffe2/python/brew.py:97: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()
    var_names, _, varkw, _= inspect.getargspec(func)  

Expected behavior

Remove these deprecation warnings.

Environment

  • PyTorch version: 1.4.0+cu92
  • Is debug build: No
  • CUDA used to build PyTorch: 9.2
  • OS: Ubuntu 18.04.3 LTS
  • GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
  • CMake version: version 3.10.2
  • Python version: 3.6
  • Is CUDA available: Yes
  • CUDA runtime version: Could not collect
  • GPU models and configuration: GPU 0: GeForce GTX 1080 Ti
  • Nvidia driver version: 410.104
  • cuDNN version: Could not collect

Versions of relevant libraries:

  • [pip3] numpy==1.16.5
  • [pip3] torch==1.4.0+cu92
  • [pip3] torchfile==0.1.0
  • [pip3] torchvision==0.5.0+cu92

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    caffe2triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      caffe2: Python 3 deprecation warnings about inspect.getargspec · Issue #44185 · pytorch/pytorch