VSCode中pytorch出现’torch’ has no member 'xxx’的错误

Win10 中使用Anaconda安装完pytorch后
在VSCode中输入代码时发现,对于很多需要用到的torch里的函数,VSCode均会报错。

‘torch’ has no member ‘xxx’

经过搜索资料,找到了解决办法。

在VSCode setting中搜索python.linting.pylintPath
并且修改值为(你的Anaconda安装路径)\pkgs\pylint-1.8.4-py36_0\Scripts\pylint,修改完后就不会再报错了。
如下图:
VSCode中pytorch出现'torch' has no member 'xxx'的错误

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2021-10-12
  • 2021-05-23
  • 2021-11-21
  • 2021-12-20
  • 2021-10-08
猜你喜欢
  • 2022-12-23
  • 2021-11-18
  • 2021-08-29
  • 2021-06-16
  • 2022-12-23
  • 2021-12-03
  • 2021-04-14
相关资源
相似解决方案