[OpenCV] error: (-215:Assertion failed) cn == CV_MAT_CN(dstType) && ddepth >= sdepth in function 'getLinearFilter'
·
Error Note
- 전체 에러 문구   cv2.error: OpenCV(4.9.0) /io/opencv/modules/imgproc/src/filter.simd.hpp:3231: error: (-215:Assertion failed) cn == CV_MAT_CN(dstType) && ddepth >= sdepth in function 'getLinearFilter'  OpenCV에서 seamlessClone함수 사용시 발생 할 수 있는 에러인데요.seamlessClone()의 파라미터로 주어지는 mask와 src 이미지의 데이터 타입이 달라 발생합니다.두 개의 데이터 타입을 맞춰주면 됩니다.  - 해결방법   mask = mask.astype(np.uint8)
ValueError: assignment destination is read-only
·
Error Note
- 전체 에러 문구   ValueError: assignment destination is read-only numpy 행렬의 값을 변경하려고 할 때 발생하는 에러입니다.  - 해결방법  아래처럼 ori_np.setflags(write=1) 로 속성을 변경해주면 됩니다.ori_np=ori_np.copy()ori_np.setflags(write=1)
Missing key(s) in state_dict: "clip_model.vision_tower.vision_model.embeddings.position_ids".
·
Error Note
- 전체 에러문구 Missing key(s) in state_dict: "clip_model.vision_tower.vision_model.embeddings.position_ids".  pretrain 모델을 load_state_dict를 사용하여 업로드 할 때 모델의 구조가 맞지 않아 발생하는 에러입니다.  - 해결방법 load_state_dic 함수의 파라미터로 strict=False 를 추가해주면 됩니다.model.load_state_dict(ckpt, strict=False) 이 파라미터를 추가해주면 모델을 불러올 떄 불러올 수 있는 값들만 유동적으로 불러올 수 있습니다.
TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'
·
Error Note
- 전체 에러 문구  TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks' accelerate 의 버전이 낮아 생기는 문제입니다.현재 저의 버전은 0.21.0입니다.pip list | grep accelerate 로 확인 할 수 있습니다. accelerate==0.30.0  으로 업그레이드 해주면 해결됩니다.pip install accelerate==0.30.0