Skip to content

Commit 57c5407

Browse files
authored
Improve warning when video_reader is not available (#2225)
As requested by @fmassa in comment #2216 (comment) from #2216.
1 parent 7d5b601 commit 57c5407

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

torchvision/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ def set_video_backend(backend):
6262
"Invalid video backend '%s'. Options are 'pyav' and 'video_reader'" % backend
6363
)
6464
if backend == "video_reader" and not io._HAS_VIDEO_OPT:
65-
warnings.warn("video_reader video backend is not available")
65+
message = (
66+
"video_reader video backend is not available."
67+
" Please compile torchvision from source and try again"
68+
)
69+
warnings.warn(message)
6670
else:
6771
_video_backend = backend
6872

0 commit comments

Comments
 (0)