vision: Improve error message when incompatible torchvision / PyTorch are used
A number of users report errors on the C++ operators when they update either PyTorch or torchvision, see for example https://github.com/pytorch/vision/issues/1916, with errors such as
RuntimeError: No such operator torchvision::nms
We should improve the error message and instead point out that their pytorch / torchvision versions are incompatible. This will give a better user experience.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 18 (12 by maintainers)
@pmeier
My bad, this is how I think the compatibility matrix should look like
torch
torchvision
python
master
/nightly
master
/nightly
>=3.6
1.5.0
0.6.0
>=3.5
1.4.0
0.5.0
==2.7
,>=3.5
,<=3.8
1.3.1
0.4.2
==2.7
,>=3.5
,<=3.7
1.3.0
0.4.1
==2.7
,>=3.5
,<=3.7
1.2.0
0.4.0
==2.7
,>=3.5
,<=3.7
1.1.0
0.3.0
==2.7
,>=3.5
,<=3.7
<=1.0.1
0.2.2
==2.7
,>=3.5
,<=3.7
Speaking for myself, I’m only really concerned with the release versions available via conda/pip. I don’t foresee a situation in which I’d personally need to figure out the PyTorch version compatibilities for old Torchvision nightly builds.
A correction for the table: the torchvision 0.5.0 package on PyPI requires torch==1.4.0, and it looks like torch 1.4.1 and 1.4.2 don’t exist.
No, we will only enforce to be compatible with latest release, if it ends up working with older releases (if compiled from source) that’s a bonus, not a requirement.
My thinking was: import should not error. Users might not want to use C++ extensions, and the code should still hopefully work fine in most cases. But if the user calls into a C++ extension, then they should ideally get a good error message.
Fair point. One of the issues we currently have is that in order to support torchhub, we need to catch an error at import and not hard-fail. But this makes error messages down the road a bit worse IMO.
I was referring to a table like https://github.com/pytorch/text#installation
I agree, let’s not overly complicate the problem. Having a compatibility matrix in the readme, and a better error message when running C++ ops that failed loading the
.so
pointing to the compatibility matrix should be enough I thinkOut of curiosity: does a list of compatible versions exist somewhere?