diff --git a/torchvision/io/image.py b/torchvision/io/image.py index 416174db387..900ac4e36d2 100644 --- a/torchvision/io/image.py +++ b/torchvision/io/image.py @@ -10,7 +10,12 @@ try: _load_library("image") except (ImportError, OSError) as e: - warn(f"Failed to load image Python extension: {e}") + warn( + f"Failed to load image Python extension: '{e}'" + f"If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. " + f"Otherwise, there might be something wrong with your environment. " + f"Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?" + ) class ImageReadMode(Enum):