터미널에 git bash 열고

끝~ .. 현타

 

똑똑한 녀석....

 

대충 실행 되었다는 이미지

 

dktltvkf...

error : cv2.error: opencv(4.5.3) ~: error: (-2:unspecified error) the function is not implemented. rebuild the library with windows, gtk+ 2.x or cocoa support.

solution : https://stackoverflow.com/questions/57427233/module-cv2-cv2-has-no-attribute-ximgproc

 

Module 'cv2.cv2' has no attribute 'ximgproc'

I am trying to perform a selective search to an image using OpenCV but when I run my code I get this: >>> import cv2 >>> ss = cv2.ximgproc.segmentation.

stackoverflow.com

 

cv2.error: OpenCV(4.5.3) error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

솔루션 : .... 이게 안될리가 없는데 그럼에도 불구하고 안되는 이유는.... 이미지가 안들어갔을 확률이 큼... 따라서 resize의 property인 image src 가 잘 들어갔는지... 출력해보기......

와 진짜 이미지 안들어갔네;;

 

----- 추가

image = cv2.imread(test, cv2.IMREAD_COLOR)			# 오류 발생

image = np.fromfile(test, np.uint8)					# 해결
image = cv2.imdecode(image, cv2.IMREAD_COLOR)		# 해결

 

요렇게 고쳐야한다.

왜냐하면, 이미지의 경로에 한글!!!!!! 이 들어갔는데, 이게 내부 구조적으로 안읽힌다.

그래서 unicode8로 변환해줘야만 하는 것이었다. 그리고 imdecode에 넣고 이미지를 불러오면 됨.

imread를 한번에 쓰려고 하니까 발생한 오류이다하하

 

 

* error : cv2.error: OpenCV(4.7.0) C:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

 

* 원인 : imread()에서 가져온 이미지 데이터가 없다는 뜻. _src.empty()   그러니까 이미지 데이터 잘 가져오고 있는지 log 찍어보기.

 

 

* ImageAI를 설치하기 위해 Anaconda에 lib를 설치 중이었다. ImageAI는 tensorflow가 1.4.0버전과 그 이상의 버전을 필요로하기 때문에 에러 문구와 함께 나온 다른 버전을 설치하던가... 아니면 설치하려는 tensorflow에 적합한 python버전으로 업그레이드 해줘야한다. 나같은 경우에는 python 버전을 동일하게 가져가야하므로 tensorflow의 버전을 높여서 (그냥 설치하면 최신 버전으로 설치 됨) 설치해보려고 한다.

요구하는 버전 : Python 3.5.1 or higher / Tensorflow 1.4.0 or higher

* error : 

ERROR: Could not find a version that satisfies the requirement tensorflow==1.4.0 (from versions: 1.13.1, 1.13.2, 1.14.0, 1.15.0, 1.15.2, 1.15.3, 1.15.4, 1.15.5, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0)
ERROR: No matching distribution found for tensorflow==1.4.0

* solution : pip install tensorflow

 

+ Recent posts