[이왜안?] 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
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- nanobody
- 오일석기계학습
- 백준
- 3B1B따라잡기
- manim library
- manim
- 제한볼츠만머신
- eigenvector
- 3b1b
- Manimlibrary
- Matrix algebra
- MLE
- 인공지능
- eigenvalue
- kld
- 베이즈정리
- ai신약개발
- 선형대수
- 나노바디
- variational autoencoder
- MorganCircularfingerprint
- MatrixAlgebra
- manimtutorial
- elementry matrix
- kl divergence
- 최대우도추정
- 기계학습
- 파이썬
- marginal likelihood
- 이왜안
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함