Package libjpeg and libpng within torchvision
See original GitHub issueWith the addition of image-reading functions enabled by default in torchvision #1632 #1881 #1909, we will need to properly package libjpeg and libpng (and other libraries will be used soon as well, like ffmpeg) so that users of {Windows, Linux, OSX} x {pip, conda, source} can use those new functionalities in torchvision without issues.
I believe the current recommended way that PyTorch deals with 3rd-party libraries is the following:
- for conda, we use conda’s package manager to handle the dependencies. Both libjpeg and libpng are available in standard channels, although I’m not sure if using the
conda-forge
channel would bring problems due to conflicts with other libraries we use. - for pip, I believe the preferred way is to include the libraries together with the torchvision wheel
- for source, we would need to handle the common installation locations, or at least provide clear instructions on how to provide the path to the libraries, either via CMake or performing the handling via python like Pillow does (although the logic seems quite intricate).
We will also need to make sure our CI (which is fairly tied to binary builds) is updated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Failed to load image Python extension: Could not find module
I solved it by installing libpng and libjpeg with Homebrew and ... lib\site-packages\torchvision\io\image.py:13: UserWarning: Failed to load ...
Read more >torchvision - PyPI
The torchvision package consists of popular datasets, model architectures, ... Notes: libpng and libjpeg must be available at compilation time in order to ......
Read more >Package List — Spack 0.20.0.dev0 documentation
This is a list of things you can install using Spack. It is automatically generated based on the packages in this Spack version....
Read more >libjpeg free download - SourceForge
... conda install libpng or any of the package managers for debian-based and RHEL-based Linux distributions, and libjpeg, which can be installed via...
Read more >Image recognition with PyTorch on the Jetson Nano - Medium
sudo apt install libjpeg-dev libfreetype6-dev pkg-config libpng-dev ... The torchvision package consists of popular datasets, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@andfoy I gave you and @rgommers triage permissions to torchvision
@fmassa said that size of the wheels isn’t critical, and just bundling in
libpng
andlibjpeg
should be fine for now. So using auditwheel (Linux) and delocate (macOS) seems like the way to go. There’s no such tool for Windows, so there the right libs need to be copied in by hand.