Skip to content

cuda (lab-10_2_mnist_deep_cnn.ipynb) #29

@puhuk

Description

@puhuk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions