Skip to content

Commit b2e13d2

Browse files
committed
Fix macos stuff?
1 parent ea1dd93 commit b2e13d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

torchvision/io/image.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,9 @@ def _load_extra_decoders_once():
387387

388388
try:
389389
import torchvision_extra_decoders
390-
except ImportError as e:
390+
391+
assert hasattr(torchvision_extra_decoders, "expose_extra_decoders")
392+
except (AssertionError, ImportError) as e:
391393
raise RuntimeError("You need to pip install torchvision-extra-decoders blah blah blah") from e
392394

393395
# This will expose torch.ops.extra_decoders_ns.decode_avif and torch.ops.extra_decoders_ns.decode_heic

0 commit comments

Comments
 (0)