[Pytorch] num_workers가 성능에 미치는 간접적 영향
·
Pytorch
딥러닝으로 분류모델 학습도중, validation accuracy가 n epoch =>.  "class A" Acc: 98.21%,   "class B" Acc: 98.67%n+1 epoch =>   "class A" Acc: 28.96%,   "class B" Acc: 99.88%이렇게 데이터가 적은 쪽 클래스의 정확도가 대폭 감소하는 현상이 발생했습니다.원인을 찾아보니 num_workers의 값이 크면 발생할 수 있는 현상이라고 합니다. - num_workers란?  num_workers는 PyTorch의 DataLoader가 데이터를 로드할 때 사용할 서브 프로세스(worker)의 개수를 의미합니다.기본적으로 DataLoader는 데이터를 배치 단위로 불러오는데, num_workers를 늘리면 여러..
[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)
Linux ssh 연결계정 비밀번호 까먹었을 때 비밀번호 변경하기
·
Linux
Linux 서버에 ssh 연결시 비밀번호을 잊어버렸을 때, 기존 비밀번호를 몰라도 비밀번호를 변경할 수 있는 방법이 있는데요. 1. 먼저 서버의 관리자 계정으로 로그인해줍니다. 2. 아래 명령어를 입력합니다.sudo passwd {나의 아이디} 3. 아래 문구가 뜨면 새로운 비밀번호를 입력합니다.
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)