반응형

Python 266

[PyTorch] Boolean value of Tensor with more than one value is ambiguous

pred와 target값을 loss function에 전달하여 loss를 계산할때 아래와 같은 오류가 발생했다. Boolean value of Tensor with more than one value is ambiguous loss 계산 코드를 잘못 짠게 원인이었다. def mse_loss(pred, target): loss = nn.MSELoss(pred, target) return loss 위 코드를 아래와 같이 수정하니 오류 해결! def mse_loss(pred, target): loss_func = nn.MSELoss() loss = loss_func(pred, target) return loss

[에러 해결] tar: Error is not recoverable: exiting now

.tgz 파일을 tar xfvz 파일명.tgz 명령어로 압축해제 하려 했더니 아래와 같은 오류가 발생했다. gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now .tgz 파일임에도 다른 형식으로 압축되어 있어 위 오류가 발생하는 것 같다. file 파일명.tgz 로 파일 형식을 확인하면 tar로 압축되어 있다는 것을 확인할 수 있다. 따라서 아래 명령어로 압축을 해제하면 된다 tar xvf 파일명.tgz

[에러 해결] CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling `cublasCreate(handle)

pytorch lightning으로 분산학습시에 오류가 발생했다. CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling `cublasCreate(handle)` 오류 발생시 해결방법은 pytorch 버전과 cuda 버전을 맞춰줘야 한다 !@ 아래 코드를 입력하면 최신 버전 torch로 업데이트 해준다. 하하하 pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html 출처 https://discuss.pytorch.org/t/cuda-error-cublas-status-internal-error..

반응형