[SR,openCV 오류]module 'cv2' has no attribute 'dnn_superres' update version

최윤진·2023년 2월 6일

ERROR

목록 보기
1/3
post-thumbnail

📌 문제 상황

Super resolution을 실행하기 위해 아래와 같은 코드를 run 했는데 바로 오류가 났다..(시작하자마자 오류 발생)

import cv2
sr = cv2.dnn_superres.DnnSuperImpl_create()

두 번째 줄을 실행했는데

module 'cv2' has no attribute 'dnn_superres' update version

오류를 만났다..

📌 문제 해결

이것 저것 찾아보니

 pip uninstall opencv-python
 pip uninstall opencv-contrib-python
pip3 install opencv-contrib-python == 4.5.5

opencv 버전이 문제인 듯 했다.

그래서 실행해줬지만, 똑같은 오류가 발생함 ..
한 번 더 버전을 따로 지정해주지 않고 다시 실행해줌

pip3 install opencv-contrib-python

한 다섯 번 삭제했다 다시 처음부터 실행하니 오류는 해결됐다!

💡 Terminal 말고 Jupyter notebook이나 Jupyter Lab에서 바로 위의 코드를 실행할 때 proceed[y]를 선택할 수 없는데, 이때는 아래와 같이 미리 뒤에 -y를 추가해주면 된다!

pip uninstall opencv-python -y

간단하지만, 몰랐던 사실..

profile
yunjin.log

1개의 댓글

comment-user-thumbnail
2023년 2월 21일

고맙습니다..

답글 달기