Unverified Commit 57c54075 authored by Fernando Pérez-García's avatar Fernando Pérez-García Committed by GitHub
Browse files

Improve warning when video_reader is not available (#2225)

As requested by @fmassa in comment
https://github.com/pytorch/vision/issues/2216#issuecomment-630166106
from #2216.
parent 7d5b601b
...@@ -62,7 +62,11 @@ def set_video_backend(backend): ...@@ -62,7 +62,11 @@ def set_video_backend(backend):
"Invalid video backend '%s'. Options are 'pyav' and 'video_reader'" % backend "Invalid video backend '%s'. Options are 'pyav' and 'video_reader'" % backend
) )
if backend == "video_reader" and not io._HAS_VIDEO_OPT: if backend == "video_reader" and not io._HAS_VIDEO_OPT:
warnings.warn("video_reader video backend is not available") message = (
"video_reader video backend is not available."
" Please compile torchvision from source and try again"
)
warnings.warn(message)
else: else:
_video_backend = backend _video_backend = backend
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment