[Pytorch] RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
에러명 : RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 원인 - 입력 Tensor랑 너가 만든 모델(네트워크)가 각각 다른 곳에서 돌고 있다. - 예를 들어 입력 Tensor는 CPU쪽 메모리에 있는데 모델(네트워크)은 GPU에서 돌고 있다... - 상호 참조가 안되서 생기는 문제다. 해결방안 - 입력 Tensor를 GPU 메모리로 보내면 된다. - 예를 들어 입력 Tensor의 변수명이 input_tensor라 하자 - 그럼 input_tensor를 Variable(input_tensor.cuda())로 바꾸면 깔끔하게 해결된다. (Variable을 쓰려면 fr..
[오류해결노하우]
2021. 10. 4. 21:25
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 주식일지
- Notion한글입력지연
- 수익실현
- Notion입력지연
- Apple
- TQQQ
- 수익전환
- 장기투자
- weight type
- PYTHON
- 마이크로소프트
- 애플
- 미국주식
- Notion입력
- 수익
- notion
- 해외주식
- MS
- 적립식투자
- gpu
- 윈도우
- Notion한글입력
- input type
- cuda
- Microsoft
- RuntimError
- 레버리지ETF
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함
