728x90
반응형
RuntimeError : expected scalar type Double but found Float
Pytorch는 Tensor연산시 Float32으로 진행
해결 : Float32로 바꿔주기.
EX) sample_tensor.to(device, dtype=torch.float32)
Expected all tensors to be on the same device, but found at least two devices
사용하는 텐서가 두종류(CPU,GPU)가 충돌한다는 의미
해결 : sample_tensor.CPU(), sample_tensor.GPU()를 사용하여 텐서의 흐름을 통일 시켜주기
반응형
'데이터분석 > Pytorch' 카테고리의 다른 글
tensor 생략없이 (0) | 2024.05.03 |
---|---|
모델 학습 GPU 병행처리(nn.DataParallel) (0) | 2024.03.13 |
[Pytorch] 파이토치로 GPU 사용 (0) | 2022.11.28 |
[Pytorch] Tensor CPU, GPU 변경 (0) | 2022.11.28 |
[Pytorch] 파이토치 Tensor(텐서)의 최대 값, 인덱스 (1) | 2022.11.28 |
댓글