question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

pytorch minimum version isn't specified

See original GitHub issue

šŸ› Bug

Describe the bug Pytorch minimum version isnā€™t specified in the setup.py, but it should be because (e.g) torchtext 0.7 cannot be used with pytorch 1.4 nor 1.5 (it crashes on import).

To Reproduce

(venv) $ pip install torch==1.4 torchtext==0.7
...
(venv) $ python -c 'import torchtext'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "venv/lib/python3.7/site-packages/torchtext/__init__.py", line 42, in <module>
    _init_extension()
  File "venv/lib/python3.7/site-packages/torchtext/__init__.py", line 38, in _init_extension
    torch.ops.load_library(ext_specs.origin)
  File "venv/lib/python3.7/site-packages/torch/_ops.py", line 106, in load_library
    ctypes.CDLL(path)
  File "/home/andrei/.pyenv/versions/3.7.5/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libtorch_cpu.so: cannot open shared object file: No such file or directory

and with torch 1.5:

(venv) $ pip install torch==1.5 torchtext==0.7
...
(venv) $ python3 -c 'import torchtext'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "venv/lib/python3.7/site-packages/torchtext/__init__.py", line 42, in <module>
    _init_extension()
  File "venv/lib/python3.7/site-packages/torchtext/__init__.py", line 38, in _init_extension
    torch.ops.load_library(ext_specs.origin)
  File "venv/lib/python3.7/site-packages/torch/_ops.py", line 105, in load_library
    ctypes.CDLL(path)
  File "/home/andrei/.pyenv/versions/3.7.5/lib/python3.7/ctypes/__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: venv/lib/python3.7/site-packages/torchtext/_torchtext.so: undefined symbol: _ZN3c1023_fastEqualsForContainerERKNS_6IValueES2_

It does work fine with torch 1.6:

(venv) $ pip install torch==1.6 torchtext==0.7
...
(venv) $ python3 -c 'import torchtext'

Expected behavior Either the torchtext package should specify a minimum version of pytorch so that it doesnā€™t get accidentally installed when Iā€™m using an older torch version, or it should work with older versions of pytorch.

Screenshots n/a

Environment

  • PyTorch Version (e.g., 1.0): 1.4.0 and 1.5.0
  • OS (e.g., Linux): Linux
  • How you installed PyTorch (conda, pip, source): pip
  • Build command you used (if compiling from source): n/a
  • Python version: 3.7
  • CUDA/cuDNN version: n/a
  • GPU models and configuration: n/a
  • Any other relevant information:

Additional context Add any other context about the problem here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
avacariucommented, Aug 19, 2020

Iā€™ll open a PR for this, because I notice thereā€™s a ā€œversion compatibilityā€ table in the README, but that should really be encoded in the setup.py.

@wconstab This issue isnā€™t really about pip vs conda, itā€™s more that new versions of torchtext are compiled against specific torch versions and you have to use compatible versions.

2reactions
avacariucommented, Aug 20, 2020

How come youā€™re unwilling to encode that information in setup.py?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] PyTorch no longer supports this GPU because it ...
Recently, I update the pytorch version to '0.3.1'. I have received the following warning message while running code: ā€œPyTorch no longerĀ ...
Read more >
Updating pytorch issues
I update my pytorch source code version from github when I install it I got many errors related to this error: there are...
Read more >
Start Locally | PyTorch
To install PyTorch via pip, and do have a CUDA-capable system, in the above selector, choose OS: Linux, Package: Pip, Language: Python and...
Read more >
Minimum CUDA compute compatibility for PyTorch 1.3
No, I am using Linux, and according to nvidia, the minimum driver for Linux is ... I don't think I am using a...
Read more >
GPU compute capability support for each pytorch version
uses a ā€œcuda versionā€ that supports a certain compute capability, that pytorch might not support that compute capability. The installationĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found