728x90
torchsummary로 pytorch의 모델의 구조를 확인하려할때 위와 같은 에러가 발생하였다.
모델이나 data가 GPU에 올라가있지 않아서 발생하는 에러라고 한다.
# dataset을 GPU에 올릴 때
torch.tensor(..., device="cuda")
torch.tensor(...).cuda()
torch.tensor(...).to("cuda")
# model을 GPU에 올릴 때
model.to("cuda")
728x90
'Error' 카테고리의 다른 글
[Python] TypeError: sequence item 0: expected str instance, int found (0) | 2024.09.04 |
---|---|
support for password authentication was removed on ~ (0) | 2023.04.20 |
ModuleNotFoundError: No module named 'cv2' (0) | 2023.04.11 |
No module named 'torch' (0) | 2023.04.11 |
Cannot find debug adapter for type 'python' (0) | 2023.02.13 |