Not working with PytorchSee original GitHub issue
Describe the bug
Whenever a file imports pytorch, it produces an error.
Traceback (most recent call last): line 3, in <module> File "/home/ayb/.local/anaconda3/envs/deep-learning/lib/python3.8/site-packages/torch/__init__.py", line 447, in <module> from .tensor import Tensor File "/home/ayb/.local/anaconda3/envs/deep-learning/lib/python3.8/site-packages/torch/tensor.py", line 13, in <module> from torch.overrides import ( File "/home/ayb/.local/anaconda3/envs/deep-learning/lib/python3.8/site-packages/torch/overrides.py", line 1212, in <module> has_torch_function = _add_docstr( RuntimeError: function '_has_torch_function' already has a docstring
To Reproduce Open AREPL with a file imports pytorch with
Screenshots If applicable, add screenshots to help explain your problem.
Other Information (please complete the following information):
- OS: Ubuntu 20.04
- Python Version: 3.8.4 (conda)
- PyTorch version: 1.8.1
It actually works for the first time it runs, then produces this error.
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Unfortunately doesn’t look like there’s a easy solution to this… the docstring gets added in C code, and I’m not a C expert. See https://github.com/pytorch/pytorch/blob/059a717c9e1e08485f5ef3f13738d1f3e5a33d9e/torch/csrc/Module.cpp
Possibly related: https://github.com/pytorch/pytorch/issues/6998
Good workaround. When the library is in there AREPL starts completely fresh each time.
On Mon, Mar 14, 2022, 7:54 AM Jaideep Singh Heer @.***> wrote:
numpy still loads twice for some reason.
— Reply to this email directly, view it on GitHub https://github.com/Almenon/AREPL-vscode/issues/401#issuecomment-1066900787, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDZTBIHEKRES4ZJVH2KPI3U75HLBANCNFSM457SDUPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you commented.Message ID: @.***>