torch 和 torchvision 版本不兼容问题

问题描述:

"Couldn’t load custom C++ ops. This can happen if your PyTorch and "
RuntimeError: Couldn’t load custom C++ ops. This can happen if your PyTorch and torchvision versions are incompatible, or if you had errors while compiling torchvision from source. For further information on the compatible versions, check https://github.com/pytorch/vision#installation for the compatibility matrix. Please check your PyTorch version with torch.version and your torchvision version with torchvision.version and verify if they are compatible, and if not please reinstall torchvision so that it matches your PyTorch install.

解决措施:

这个有很多的原因,下面将一一列出,请自己对照!

原因一:

        torch 和 torchvision 的版本不匹配,建议安装匹配的版本。见 匹配表格

原因二:

        本地同时存在多个版本的torch,此时需要先卸载之后重新安装。

pip uninstall torch
pip install torch

原因三:

        当你发现自己不是以上两种问题的时候,请你检查自己的torch版本是不是1.10.0以上的,这个版本目前可能不太稳定,自行卸载之后,下载稍微低一点的版本即可(注意要torch和torvision的版本一起改!)

  • 8
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值