HUR Lab

  • 홈
  • 태그
  • 방명록

pytorch error 2

[Error] Pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAType instead

문제상황 : 모델이나 데이터가 일부는 cpu에, 일부는 gpu에 올라가있어서 연산이 안되는 문제 출력 Pytorch RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got CUDAType instead 해결방법 : cuda에 모델 혹은 데이터를 잘 올렸는지 모델/데이터를 다 확인한다. .cuda()를 통해 처리할 수 있는데 이게 가끔 tensor들을 덜올리고 처리하는 경우 (꼼꼼하지 못하면 굉장히 자주) 발생하게 된다...

Error 2022.01.31

[Pytorch] RuntimeError: Input and parameter tensors are not at the same device, found input tensor at cuda:0 and parameter tensor at cpu

RuntimeError: Input and parameter tensors are not at the same device, found input tensor at cuda:0 and parameter tensor at cpu 결론은 input과 parameter tensor가 cpu / gpu에 나눠서 들어가있다는것이다. 나의 실수는 모델을 수정하면서 data는 gpu에 올려놓고 수정한 모델은 gpu에 올려놓지 않아서 rnn cell 돌릴때 default로 cpu로 잡혀서 두개의 공간이 다르기때문에 연산이 불가했던 것... 다른 github issue로 data를 gpu에 올려놓지 못하는 error 상황이 나는것같은데 그런건 아니고 그냥 잘 확인하자. 모델이 어디에서 돌아가고있는지

Error 2022.01.27
이전
1
다음
더보기
프로필사진

HUR Lab

공부한것을 정리하는 블로그입니다

  • 분류 전체보기 (39)
    • Math (1)
    • Machine Learning (0)
    • Deep Learning (4)
      • Attention Mechanism (3)
      • GAN (1)
      • Graph Neural Network (0)
      • Fundamental theory (0)
    • Computer Science (0)
      • Algorithm & Data structure (0)
      • Network (0)
      • Computer Structure (0)
      • Operating System (0)
      • Computer Vision (0)
    • Project (0)
      • Web (0)
      • Machine Learning (0)
      • Mobile (0)
    • Research (2)
      • Image-Text matching (0)
      • Compositional Image-Text re.. (1)
      • Zero-Shot Learning (0)
      • Video-Text retrieval (1)
      • Self-supervised Learning (0)
    • Error (15)
    • TIL (0)
      • English (0)
    • 강의정리 (0)
    • Coding Test (16)
      • 정렬 (16)

Tag

파이썬 error, flutter list generate, 백준 7795 파이썬, 백준 11399 파이썬, 백준 1302 파이썬, tensorflow 2, 백준 2012 파이썬, resnet50, Vision Transformer, 백준 1431 파이썬, pyTorch, 백준 2309 파이썬, 알고리즘 테스트, 백준 1181 파이썬, pytorch error, 백준 18870 파이썬, 백준 8979 파이썬, 백준 18310 파이썬, 백준 10610 파이썬, 알고리즘 테스트 #백준 2750 파이썬 #백준 2751 파이썬,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바