question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package libjpeg and libpng within torchvision

See original GitHub issue

With 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.

cc @seemethere @rgommers

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
fmassacommented, Jun 6, 2020

@andfoy I gave you and @rgommers triage permissions to torchvision

1reaction
rgommerscommented, Jun 5, 2020

for pip, I believe the preferred way is to include the libraries together with the torchvision wheel

@fmassa said that size of the wheels isn’t critical, and just bundling in libpng and libjpeg 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found