【CV】pycharm中的报错

1.Unresolved attribute reference ‘next’ for class ‘Iterator’

神经网络中使用dataiter.next()时出现在这里插入图片描述
笔者尝试了下面两种方法都没有成功

  • 方法一
    File → Settings → Editor → File Types → Ignore files and folders,去除框中的:init.py;,然后确认,等待文件重新扫描
    (笔者这个框中没有__init__.py,所以尝试了第二种方法依然没有成功)
  • 方法二
    File → Invalidate Caches,选择Invalidate and Restart,等待重启
    参考/引用

此文指出这是个pycharm的bug
笔者的pycharm版本为2021.3 (Community Edition)
目前还没有解决这个问题

2.OSError: [WinError 1455] 页面文件太小,无法完成操作。

https://www.cnblogs.com/blue-lin/p/14982097.html

3.Unused import statement ‘import torch’

问题描述:
代码中使用了torch,但import torch依然显示为灰色,提示Unused import statement 'import torch'
在这里插入图片描述
解决1:
File→Invalidate Caches…→Invalidate and Start
然后等待pycharm重启即可
在这里插入图片描述
在这里插入图片描述
解决2:
光标停留在import torch上,点击小灯泡,再点Optimize imports右侧的小箭头,然后点击Suppress for a statement
在这里插入图片描述

4.“ImportError: cannot import name ‘imresize’”

见链接

猜你喜欢

转载自blog.csdn.net/qq_42475234/article/details/123037018