栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

import torch不报错但是import torchvision报错:UserWarning:Faild to load image Python extension:Could not解决二

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

import torch不报错但是import torchvision报错:UserWarning:Faild to load image Python extension:Could not解决二

import torch不报错但是import torchvision报错:UserWarning:Faild to load image Python extension:Could not解决二

可能是你的torch和torchvision版本不对应

我是在运行yolo5时发现的错误,yolo5要求torch>=1.6就可以,那我们就先卸载原来的torch和torchvision,再安装新的,打开anaconda prompt,
1.输入如下命令卸载

pip uninstall torch
pip uninstall torchvision

2.然后查看对应cuda和torch1.6.0和torchvision0.7.0命令进行安装


或者想安装其他版本torch,可以在https://pytorch.org/查询
3.要查看自己cuda版本只需要cmd输入如下命令:

nvcc -V

4.我是cuda10.2

conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.2 -c pytorch
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/689318.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号