본문 바로가기 메뉴 바로가기

따스한 개발자

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

따스한 개발자

검색하기 폼
  • 분류 전체보기 (9)
    • [해외주식일지] (6)
    • [드론개발일지] (0)
    • [오류해결노하우] (3)
  • 방명록

PYTHON (1)
[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
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 레버리지ETF
  • 수익전환
  • RuntimError
  • MS
  • cuda
  • Notion입력지연
  • 해외주식
  • Notion한글입력
  • weight type
  • 윈도우
  • 미국주식
  • notion
  • 주식일지
  • 장기투자
  • 마이크로소프트
  • Notion한글입력지연
  • 애플
  • 수익실현
  • PYTHON
  • 수익
  • Notion입력
  • TQQQ
  • input type
  • Microsoft
  • 적립식투자
  • gpu
  • Apple
more
«   2026/01   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바