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

`from classy_vision import dataset` will fail with current version of torchvision (0.14.0) #798

Closed davidefiocco closed 1 year ago

davidefiocco commented 1 year ago

šŸ› Bug

One can't import classy_vision.dataset with the current version of torchvision==0.14.0.

To Reproduce

To reproduce the behavior run:

from classy_vision import dataset

the command should fail with

ImportError: cannot import name Kinetics400 from 'torchvision.datasets.kinetics' (/usr/local/lib/python3.8/dist-packages/torchvision/datasets/kinetics.py)

This is most likely because torchvision deprecated Kinetics400 in 0.12.0: https://pytorch.org/vision/0.12/generated/torchvision.datasets.Kinetics400.html?highlight=kinetics#torchvision.datasets.Kinetics400

Expected behavior

The command above should work flawlessly. Downgrading torchvision to 0.12.0 is a workaround for this issue - a constraint such as torchvision<= 0.12.0 may be added as fix in https://github.com/facebookresearch/ClassyVision/blob/74e83dd97afbc9371b336304af09548f5080fa9c/requirements.txt#L4

Environment

python collect_env.py gives me:

PyTorch version: 1.13.0+cu116
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
CMake version: version 3.22.6
Libc version: glibc-2.27

Python version: 3.8.16 (default, Dec  7 2022, 01:12:13)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.10.133+-x86_64-with-glibc2.27
Is CUDA available: False
CUDA runtime version: 11.2.152
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.1.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.1.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.21.6
[pip3] torch==1.13.0+cu116
[pip3] torchaudio==0.13.0+cu116
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.14.0
[pip3] torchvision==0.14.0+cu116
johnnynunez commented 1 year ago

https://github.com/facebookresearch/ClassyVision/pull/800

mannatsingh commented 1 year ago

Hi @davidefiocco and @johnnynunez apologies for not responding to this -- the issue didn't get assigned to me so I just noticed it.

Classy Vision is not being actively maintained anymore. That being said, we released the latest version of Classy Vision (0.7.0), where I am able to run from classy_vision import dataset.

davidefiocco commented 1 year ago

Thanks @mannatsingh, it works OK in 0.7.0!