공부해볼라는 스토리

  • 홈
  • 태그
  • 방명록

Error #RuntimeError #tensor 1

[Error] RuntimeError: Sizes of tensors must match except in dimension []. Expected size [] but got size [] for tensor number 1 in the list.

딥러닝 모델을 구축하면서 내가 오류가 나왔던 부분인데,, 음 내 상황은 일단 모델 학습 시에 batch_size를 설정하고 그만큼 계속 받으려는데 batch_size에 input data가 딱 나눠떨어지지 않아서 받는 사이즈가 틀렸다고 계속 나왔다 ㅋㅋㅋ ㅠㅠ ㅋ,,, embedding = self.embedding(ids).reshape(cfg['batch_size'], N) 약간 이런 코드로 썼는데 batch_size만큼 input이 크지 않아서 계속 오류가 떴다 흐으으음 이때 try~catch문으로 사이즈 조절할 수 있게 하거나 찾아보니까 transforms.Resize하는 방법도 있다는데 좀 더 방법이 생기면 추가해야겠다

Python/Error 2022.12.27
이전
1
다음
더보기
프로필사진

NLP 잘하고 싶다 https://github.com/HyeLynnKIM

  • 분류 전체보기 (141)
    • ML\DL (19)
      • LGAimers (13)
      • Machine Learning (2)
      • Deep Learning (2)
    • Algorithm (68)
      • BOJ (22)
      • Programmers (14)
      • SQL (9)
      • STUDY (17)
    • Python (13)
      • Error (9)
    • NLP (29)
      • Transformers for NLP (5)
      • Paper Review (14)
      • Do it! ~ NLP (5)
    • DataAnalysis (1)
    • Latex\Overleaf (1)
    • Github (4)
      • Git (0)
      • Markdown (2)
    • Etc (4)
    • 취준 (0)

Tag

error #python #runtimeerror #grad_fn #requres_grad, latex #overleaf #chicago #reference, Error #RuntimeError #tensor, if, NLP #GLUE #GLUE TASK #NLU, Programmers #SQL #MySQL #Oracle, programmers, lstm #binary분류 #python, cuda #tensorflow #cuda10.0 #gpu, TRY, Python #KFold #StratifiedKFold #sklearn, linux #한영전환키 #xrdp #Hangul, python, python #error #torch, NLP #QA #EMNLP #SQuAD, bash #conda #activate, python #re #정규표현식 #정규식,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

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

티스토리툴바