본문 바로가기
728x90
반응형

Error Correction8

KeyError: 15 - Dataset 클래스 정의 할 때 pandas 사용 주의점 Segmentation 모델을 훈련하기 위해 훈련 코드는 복붙, 수정하고 Dataset 클래스는 직접 만들었다. 그랬더니 아래와 같은 오류가 발생했다. 처음에는 복붙, 수정하면서 파라미터가 꼬인 줄 알았지만, pandas의 인덱싱 에러다. 하필 0번째 인덱스를 확인했을 때 잘 돌아가서 오류 위치를 찾는 데 더 오래 걸렸다. 15번째 인덱스를 조회하면 다음과 같이 오류가 발생한다. from sklearn.model_selection import train_test_split train_df,val_df,_,__ = train_test_split(train_df,train_df,test_size=0.2,random_state=CFG['SEED'],stratify=train_df.cls) train_datas.. 2023. 4. 16.
error: OpenCV(4.7.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\subdivision2d.cpp:288: error: (-211:One of the arguments' values is out of range) in function 'cv::Subdiv2D::locate' cv2.Subdiv2D는 2D 평면을 Delaunay triangulation 하는 함수다. 이 함수를 사용하다가 제목과 같은 오류가 발생했다. chatGPT를 활용하여 함수를 만들었는데 코드는 아래와 같다. def get_triangulation(landmarks1, landmarks2): """ Given two sets of corresponding landmarks, computes and returns their Delaunay triangulation. """ # Create an empty rectangle that covers both images rectangle = (0, 0, max(landmarks1.max(axis=0)[0], landmarks2.max(axis=0)[0]), ma.. 2023. 4. 10.
ipynb file No module named ‘package’ error 더보기 주피터 노트북 파일에서 폴더나 패키지를 import할 때마다 경로 설정 법을 찾기 귀찮아서 적음 .py 파일에서 문제 없이 돌아가는 코드를 .ipynb 파일에서 복사하여 실행하려 하면 다음과 같은 오류를 볼 수 있다. 해결 방법 sys.path에 root 디렉토리 하위 폴더를 모두 append한다. 필요한 폴더만 append하는 게 아니라 모든 폴더를 추가하므로 효율적인 방법은 아니다. def ipy_path_append(root=None): r = root if root is not None else os.getcwd() for path in os.listdir(r): if os.path.isdir(path): ipy_path_append(path) if path not in sys.path: .. 2023. 4. 2.
Tensorflow zlibwapi.dll error 더보기 cuda를 밀고 다시 설치하거나 새로운 환경에서 코드를 돌릴 때 마다 까먹어서 적음 Tensorflow를 이용하여 코드를 돌리다가 아래와 같은 에러를 볼 수 있다. 1) 2) 해결 방법 아래 링크 이동 후 zlibwapi.dll 다운로드 https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-zlib-windows Installation Guide :: NVIDIA Deep Learning cuDNN Documentation The following steps describe how to build a cuDNN dependent program. You must replace 8.x and 8.x.y.z with yo.. 2023. 4. 2.
728x90
반응형