전체 글
-
[PyTorch Warning] W accumulate_grad.h:170 Warning: grad and param do not obey the gradient layout contract.Programming Error/PyTorch 2021. 7. 13. 16:41
[W accumulate_grad.h:170] Warning: grad and param do not obey the gradient layout contract. This is not an error, but may impair performance. grad.sizes() = [64, 768, 1, 1], strides() = [768, 1, 1, 1] param.sizes() = [64, 768, 1, 1], strides() = [768, 1, 768, 768] (function operator()) PyTorch Framework로 모델을 학습하는 도중에 다음과 같은 Warning을 만났습니다. Error는 아니고 Warning이라 넘어갈까했지만 may impair performance 성능을 ..
-
[OpenCV 오류] error: OpenCV -209:Sizes of input arguments do not matchProgramming Error/Python 2021. 7. 11. 14:18
error: OpenCV(4.4.0) pip-req-build-wef8acrf\opencv\modules\core\src\arithm.cpp:669: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op'. Python을 사용하던 도중 cv2.multiply 함수를 사용할 일이 있었는데 3채널과 1채널짜리의 동일한 H,W 크기의 이미지를 서로 곱해..
-
[Pandas interpolate 함수 동작하지 않는 현상]Programming Error/Python 2021. 7. 1. 19:08
아래 그림과 같이 DataFrame을 사용할 때 결측값이 존재하는 경우, pandas에 내장된 interpolate 함수를 사용하여 채우는 경우가 있습니다. df = df.interpolate(method='linear') 그런데 위 함수를 사용하여도 NaN이 채워지지 않고, 그대로 있는 경우가 발생합니다. 이는 아래와 같이 Data의 타입이 object인 경우에 발생합니다. df['column1'] = df['column1'].astype('float') 따라서, float형태로 변환후 interpolate를 수행하면 정상적으로 작동합니다.