AttributeError: cannot assign module before Module.__init__() call
·
Error Note
- 에러 문구 AttributeError: cannot assign module before Module.__init__() call 신경망 모델 설계시 super().__init__()을 빼먹어 생기는 문제입니다. 아래 처럼 코드에 추가해주면 해결 가능합니다. class Block(nn.Module): def __init__(self, in_channel, hidden_channel, out_channel): super(CBlock, self).__init__() . . .
RuntimeError: Unable to find a valid cuDNN algorithm to run convolution
·
Error Note
- 전체 에러 문구 RuntimeError: Unable to find a valid cuDNN algorithm to run convolution - 해결 방법 GPU 메모리 부족으로 발생하는 에러입니다. batch size를 작게 조절해주면 해결!
TypeError: only integer scalar arrays can be converted to a scalar index
·
Error Note
- 전체 에러 문구 TypeError: only integer scalar arrays can be converted to a scalar index 여러 개의 numpy array를 concat 할 때 발생하는 에러입니다. concatenate() 함수에 tuple 형식의 matrix을 사용하지 않았기 때문에 발생하는 에러입니다. - 해결 방법 np.concatenate((y_h, cb_h, cr_h)) 연결하고자 하는 행렬들을 tuple로 묶어주면 됩니다.
runtimeerror: found dtype long but expected float
·
Error Note
- 전체 에러 문구 runtimeerror: found dtype long but expected float => 데이터 타입이 맞지 않아 생기는 에러입니다. - 해결 방법 .to() 함수를 사용해 데이터 타입을 변경해주면 됩니다. my_tensor.to(torch.float32)