pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.32k stars 6.97k forks source link

torchvision is restricted to ffmpeg-4 on conda #8697

Open bschindler opened 1 month ago

bschindler commented 1 month ago

🐛 Describe the bug

torchvision is retricted to ffmpeg-4 on conda currently. This makes it impossible for me to upgrade my environment to newer versions of torch. The reason is that I need additional libraries which depend on newer versions of ffmpeg. ffmpeg-5 was released in 2022 so it's no surprise that some packages depend on it (or newer).

I saw in the commit log that the reason is a build failure, so I have mild hopes that this is something that could be worked around?

Versions

Given the output of the script and the nature of the issue, this is likely meaningless. I am currently using [conda] torchvision 0.16.2 py310_cpu pytorch I can go a bit higher, but not to where I need to (which is 0.19/0.20)

NicolasHug commented 1 month ago

Hi @bschindler , sorry for the inconvenience. We aim to consolidate pytorch video decoding capabilities within https://github.com/pytorch/torchcodec, and we'll soon be deprecating video decoding in torchvision. So unfortunately, this isn't something we'll fix within torchvision. I encourage you to give torchcodec a try though, it is not pinned against any ffmpeg version, you can run it against ffmpeg 4, 5, 6, or 7.

bschindler commented 1 month ago

Thank you for your answer. We are actually not in need of the ffmpeg functionality but rather on the other more core functionality of torchvision. Deprecation sounds like its gonna stay for a while until its removed which essentially tells me that I am blocked from updating until this functionality is gone? Do you have a rough timeframe in mind on how much time I am looking at?

NicolasHug commented 1 month ago

:disappointed: Sorry. Is there a chance you can install from pip instead of installing from conda?

bschindler commented 1 month ago

With conda, apart from having safety that binaries are compatible with each other, we also have the option to use a cpu only build and a cuda-enabled build (with cuda 11.8 which is what we are currently using). How is this handled on the pip side? I am only seeing a "bare" torchvision build without differentiation.

NicolasHug commented 1 month ago

There are cpu-specific and cuda-specific wheels for torchvision too https://download.pytorch.org/whl/torchvision/

I hope that as long as you install torchvision along with torch in the same command and with the right --index-url, e.g. following https://pytorch.org/get-started/locally/, you should be fine?