【解决方法】AttributeError: module ‘cv2‘ has no attribute ‘INTER_NEAREST‘

linux docker上安装paddleocr 遇到这个问题

  File "/usr/local/lib/python3.6/site-packages/imgaug/__init__.py", line 7, in 
    from imgaug.imgaug import *  # pylint: disable=redefined-builtin
  File "/usr/local/lib/python3.6/site-packages/imgaug/imgaug.py", line 53, in 
    cv2.INTER_NEAREST, cv2.INTER_LINEAR, cv2.INTER_AREA, cv2.INTER_CUBIC]
AttributeError: module 'cv2' has no attribute 'INTER_NEAREST'

  • 尝试一下 pip install opencv-contrib-python-headless==4.2.0.32,我这边用4.4的headless也是ok的
  • 补充一下:需要先将环境中opencv的相关包都删除干净,再安装headless

我是用此方法解决该问题。

原链接:https://github.com/PaddlePaddle/Paddle/issues/29507

你可能感兴趣的:(bug调试,paddlepaddle,python,人工智能)