
for i , (inputs, labels) in enumerate(trainloader, 0):
inputs, labels = inputs.to(device), labels.to(device)
optimizer.zero_grad()
#### error 가 난 위치
outputs = net(inputs)
####
loss = criterion(outputs, labels)
input은 device("cuda") 로 설정해준반면 모델인 net는 설정해주지 않아 발생한 에러이다.
'Python > Error' 카테고리의 다른 글
| gpu 종류 확인하는 명령어 (0) | 2024.02.27 |
|---|---|
| [Error] RuntimeError: Output 0 of UnbindBackward is a view and is being modified inplace. (0) | 2023.10.16 |
| 파일이 존재하는데 'No such file or directory' error가 날 때 (0) | 2023.10.13 |