1、问题
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.
大致的意思是说当前环境的 PyTorch 和 torchvision 版本不匹配,建议重新安装 PyTorch 和 torchvision。
2、解决方案:
重新安装 pytorch 环境,保证 PyTorch 和 torchvision 版本匹配。
建议到 pytorch 官网 找到版本匹配的 Pytorch 和 torchvision 进行安装。