# 마우스 효과 팅커벨
본문 바로가기 메뉴 바로가기

벼랑끝 바이오 매드 컴퓨터 사이언티스트

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

벼랑끝 바이오 매드 컴퓨터 사이언티스트

검색하기 폼
  • 분류 전체보기 (151)
    • Background (63)
      • Biology (8)
      • Math (42)
      • Statistics (8)
      • English (5)
    • Computer (66)
      • 백준 풀이 (7)
      • 이게 왜 안되지? (23)
      • 코딩 개꿀팁 (21)
      • 3B1B 따라잡기 with ManimLibrary (15)
    • Paper (4)
      • Bioinformatics (2)
      • CS (2)
    • Daily (16)
      • review (6)
      • etc (10)
  • 방명록

인공지능 (2)
[이왜안?] Input and hidden tensors are not at the same device, found input tensor at cuda:0 and hidden tensor at cpu

Cuda:0, Cpu 두 키워드가 에러에 동시에 출력되면 그냥 거의 백이면 백, 특정 변수는 GPU의 메모리(VRAM)에, 어떤 변수는 CPU의 메모리(RAM)에 올라와 있다고 생각하면 된다. 다음과 같은 경우를 주로 살펴보면 해결된다. model.to(device)만으로는 모델 내부에서 생성되는 변수는 device에 자동으로 올라가지 않는다. 예를들어 다음과 같은 코드를 보자 def forward(self, v): # 1. CNN ... if config['rnn_Use_GRU_LSTM_target'] == 'LSTM': h0 = torch.randn(self.direction * ... ) c0 = torch.randn(self.direction * ... ) v, (hn,cn) = self.rnn(..

Computer/이게 왜 안되지? 2022. 12. 31. 03:10
[이왜안?] Input type (torch.FloatTensor) and weight type (torch.DoubleTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor

brief solution. 1. Whenever you train your model. You must check if your model and input data both are on the same device. (cpu or cuda) 2. And you must check the input data type and model parameters' data type are same Input type은 torch.FloatTensor인데 weight type(model parameter)는 torch.DoubleTensor라서 나타나는 에러라고 생각된다. for epoch in range(train_epoch+1): model.train() for i, (v_d, v_p, label) in en..

Computer/이게 왜 안되지? 2022. 12. 30. 17:06
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
  • 벼랑끝 깃허브
  • 벼랑끝 강아지
TAG
  • kl divergence
  • 최대우도추정
  • manim
  • eigenvector
  • elementry matrix
  • kld
  • eigenvalue
  • 3B1B따라잡기
  • 선형대수
  • manimtutorial
  • 백준
  • variational autoencoder
  • 3b1b
  • nanobody
  • 오일석기계학습
  • Matrix algebra
  • MLE
  • 나노바디
  • 기계학습
  • 파이썬
  • Manimlibrary
  • MatrixAlgebra
  • 이왜안
  • marginal likelihood
  • manim library
  • 인공지능
  • 베이즈정리
  • 제한볼츠만머신
  • ai신약개발
  • MorganCircularfingerprint
more
«   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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바