facebookresearch / ClassyVision

An end-to-end PyTorch framework for image and video classification
https://classyvision.ai
MIT License
1.59k stars 278 forks source link

classy-vision==0.5.0 is incompatible with torch==1.9.0 #749

Closed d4l3k closed 3 years ago

d4l3k commented 3 years ago

🐛 Bug

classy-vision latest release is incompatible with the latest version of torch due to a dependency on torch._six which has since been removed.

To Reproduce

Steps to reproduce the behavior:

$ virtualenv -p ~/.pyenv/versions/3.9.5/bin/python3 ~/venvs/classy_incompatible
$ source ~/venvs/classy_incompatible/bin/activate.fish
$ pip install classy_vision torch
$ python
Python 3.9.5 (default, Jun  7 2021, 12:00:52) 
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from classy_vision.dataset.classy_dataset import ClassyDataset
/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/torchvision/transforms/_functional_video.py:5: UserWarning: The _functional_video module is deprecated. Please use the functional module instead.
  warnings.warn(
/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/torchvision/transforms/_transforms_video.py:25: UserWarning: The _transforms_video module is deprecated. Please use the transforms module instead.
  warnings.warn(
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/classy_vision/dataset/__init__.py", line 11, in <module>
    from .classy_dataset import ClassyDataset
  File "/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/classy_vision/dataset/classy_dataset.py", line 9, in <module>
    from classy_vision.dataset.transforms import ClassyTransform
  File "/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/classy_vision/dataset/transforms/__init__.py", line 109, in <module>
    import_all_modules(FILE_ROOT, "classy_vision.dataset.transforms")
  File "/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/classy_vision/generic/registry_utils.py", line 20, in import_all_modules
    importlib.import_module(module_name)
  File "/home/tristanr/.pyenv/versions/3.9.5/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/classy_vision/dataset/transforms/mixup.py", line 10, in <module>
    from classy_vision.generic.util import convert_to_one_hot
  File "/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/classy_vision/generic/util.py", line 21, in <module>
    from torch._six import container_abcs
ImportError: cannot import name 'container_abcs' from 'torch._six' (/home/tristanr/venvs/classy_incompatible/lib/python3.9/site-packages/torch/_six.py)

Looks like this is already fixed in trunk but a new version needs to be released.

https://github.com/facebookresearch/ClassyVision/commit/853fc0ebc8ce774c712dec006843fcb3820e9030#diff-cab22f51781936a2fc34e3d44ba1a2227babc98667a9d3f89e08317db2710a1f

Impact

This is causing our tests to fail in https://github.com/pytorch/torchx/pull/83/checks?check_run_id=2889571824

d4l3k commented 3 years ago

There's a new 0.6.0 release which appears to be compatible with torch==1.9.0, testing now https://pypi.org/project/classy-vision/#history

d4l3k commented 3 years ago

passing for torchx