Skip to content

Commit f84af6d

Browse files
authored
improve warning message for missing image extension (#7150)
1 parent 942796c commit f84af6d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

torchvision/io/image.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
try:
1111
_load_library("image")
1212
except (ImportError, OSError) as e:
13-
warn(f"Failed to load image Python extension: {e}")
13+
warn(
14+
f"Failed to load image Python extension: '{e}'"
15+
f"If you don't plan on using image functionality from `torchvision.io`, you can ignore this warning. "
16+
f"Otherwise, there might be something wrong with your environment. "
17+
f"Did you have `libjpeg` or `libpng` installed before building `torchvision` from source?"
18+
)
1419

1520

1621
class ImageReadMode(Enum):

0 commit comments

Comments
 (0)