Getting error as UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}") w

I tried executing the script model.py from the tensorrt sample python directory
/usr/src/tensorrt/samples/python/network_api_pytorch_mnist
$ python3.6 model.py
It is throwing this message

/home/mistral/.local/lib/python3.6/site-packages/torchvision/io/image.py:11: UserWarning: Failed to load image Python extension:
** warn(f"Failed to load image Python extension: {e}")**

Let me know what could be the reason.

Thank you

Hi,

It looks like a warning message.
Does the script run correctly?

Thanks.

Yes it ran but wanted to know why this error is coming and what is the solution for it.

Thank you.

Hi,

A common cause is that the PyTorch and TorchVision versions are not compatible.

Do you use our PyTorch v1.10.0 prebuilt package?
If yes, please install the TorchVision v0.11.0.

You can follow our NGC container combination to install the compatible versions.

Thanks.

Let me try and get back to you.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.