首先检查是不是下载了该包
pip list
如果没有下载该包,通过下面这个命令下载:
pip install torch=1.2.0 torchvision=0.4.0 -f https://download.pytorch.org/whl/torch_stable.html
如果下载了该包,说明你配置了多个python环境,而编辑器目前所在的python环境没有下载该包,可以选择更换编辑器环境或者重新在编辑器的环境下下载
更换环境步骤:ctrl+shift+p -->输入:python:select interpreter选择下载了该包的环境
over✌
python导包出现 Import “torch.backends.cudnn“ could not be resolved PylancereportMissingImports 没有可用的快速修复
最新推荐文章于 2023-10-29 21:58:46 发布