当前位置:   article > 正文

AttributeError: module ‘PIL.Image‘ has no attribute ‘NEAREST‘_attributeerror: module 'pil.image' has no attribut

attributeerror: module 'pil.image' has no attribute 'linear

安装TensorFlow后,运行程序出现了诡异的错误:AttributeError: module ‘PIL.Image’ has no attribute 'NEAREST’
于是我更新了以下pillow:

pip install --upgrade pillow -i https://pypi.tuna.tsinghua.edu.cn/simple

  • 1
  • 2

这里应该是版本不匹配的问题吧,当事人也不是很清楚,凡事upgrade一下总没错
重启了一下IDE,再次尝试运行,出现了新的错误:
AttributeError: module ‘PIL.Image’ has no attribute 'constant’
这个就是自己的问题,好巧不巧我将文件名命名成了TensorFlow.py,哒咩,错误就出现在这里,文件名不能和要import的模块名称相同!!!不然import的就是自己的文件,于是就出现错误了,将文件重命名一下就ok了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/575266
推荐阅读
相关标签
  

闽ICP备14008679号