PyTorch icon indicating copy to clipboard operation
PyTorch copied to clipboard

cuda (lab-10_2_mnist_deep_cnn.ipynb)

Open puhuk opened this issue 5 years ago • 0 comments

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 입니다.

puhuk avatar Jun 02 '19 14:06 puhuk