반응형 반응형 CPU1 반응형 RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same 에러해결 개발환경 - ubuntu18.04 - python3.7 1. Problem RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same pytorch로 학습을 할 때 input type과 weight type이 같아야만 한다는 에러가 발생 2. Reason GPU로 학습을 할 때 model이나 dataset를 GPU에 설정하지 않았기 때문에 발생 3. Solution torch.tensor(..., device="cuda") torch.tensor(...).cuda() torch.tensor(...).to("cuda") model.to("cuda") dataset이나 model을.. 2022. 4. 5. 이전 1 다음 반응형