deeplearningzerotoall / PyTorch

Deep Learning Zero to All - Pytorch
1.03k stars 1.33k forks source link

cuda (lab-10_2_mnist_deep_cnn.ipynb) #29

Open puhuk opened 5 years ago

puhuk commented 5 years ago

device = 'cuda' if torch.cuda.is_available() else 'cpu'

위 코드 실행 시, device 가 ('cuda',) 로 출력되어, 이후 CNN().to(device) 등의 to(device) 실행 시 오류가 출력됩니다. (to() received an invalid combination of arguments - got (tuple))

device ="cuda" if torch.cuda.is_available() else "cpu" 위 코드로 변경 후 실행 시 오류 없이 나오네요.

별거 아니지만, 혹시 유사한 에러 있으신 분은 참고하시면 좋을 것 같습니다. 참고로 제 환경은 torch 1.1.0, conda 4.6 입니다.