HUR Lab

  • 홈
  • 태그
  • 방명록

pyTorch 2

RuntimeError: Function MmBackward returned an invalid gradien

순전파는 잘 나와서 loss 값까지 잘 얻어지는데... RuntimeError: Function MmBackward returned an invalid gradien~~~~ 뭐라고 뜨면서 autograd가 문제가 생기는 현상이 있습니다. 3주동안 이것저것 다건드려봤는데 결국... pytorch 1.9.0이하의 문제라서 1.9.1 + cu111 설치했더니 바로 해결... https://discuss.pytorch.org/t/mmbackward-returned-an-invalid-gradient-at-index-0/132956 MmBackward returned an invalid gradient at index 0? I’m collecting two different measures of loss and ..

Error 2022.09.16

[Pytorch] RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead.

RuntimeError: Can't call numpy() on Variable that requires grad. Use var.detach().numpy() instead. 문제상황 : test때 gpu의 모델 추론값을 .cpu().numpy()을 통해 바꾸어 주려니 생기는 문제. 이유 : 위와 같은 상태로는 trainable tensor기 때문에 tensor를 non-trainable 상태로 바꾸어 놓고 numpy로 보내야한다. 해결방법 : vid_emb=vid_emb.cpu().detach().numpy() 설명 : vid_emb 가 모델을 통해 infer된 tensor입니다. numpy 연산을 위해 gpu > cpu로 보낸 후 .detach()를 통해 학습하지않는 텐서 형태로 바꾸어 줍니다. 이..

Error 2022.02.26
이전
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

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

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

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

티스토리툴바