程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

UserWarning: Failed to load image Python extension: warn(f“Faile

編輯:Python

The problem background

function yolov5 The following warning, Although it does not affect operation , But it looks bad . stay python In the environment import torchvision It is also the following problem , Description: unable to load torchvision library .

/home/firefly/anaconda3/envs/yolo/lib/python3.8/site-packages/torchvision/io/image.py:13:
UserWarning: Failed to load image Python extension: warn(f"Failed to load image Python extension: {e}")

Question why

pytorch and torchvision The version of does not correspond to , The picture below is pytorch and torchvision The correct corresponding version of , Please according to your own situation , reinstall pytorch Or repack torchvision.


Problem solving

1、 Into our anaconda Environmental Science ,pip list Show all our libraries . You can see my torch yes 1.11.0, According to the above table, the corresponding torchvision Should be 0.10.0, And what I installed was 0.12.0, So wrong reporting .


2、pip3 uninstall torchvision uninstall torchvision.

3、pip3 install torchvision==0.10.0 Specify installation torchvision Version of .


Once again import torchvision, There is no mistake , Successful import , Problem solving !


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved