Notice
Recent Posts
Recent Comments
Link
«   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
Tags
more
Archives
Today
Total
관리 메뉴

ufris

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1! (when checking argument for argument weight in method wrapper_CUDA__cudnn_convolution) 에러 해결 본문

딥러닝

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1! (when checking argument for argument weight in method wrapper_CUDA__cudnn_convolution) 에러 해결

ufris 2025. 2. 20. 16:01

gpu 0 만 사용해서 잘 돌아가다가 다른 학습을 위해 gpu 1번을 사용하는 순간 해당 에러가 발생

 

학습이 잘 되던 gpu 0 도 오류가 발생해서 학습이 진행 안됐는데

 

$ torch.cuda.init()  # CUDA 시스템 초기화

 

코드가 있으면 위와 같은 오류가 발생하기 때문에 해당 코드는 삭제 후 돌리니까 오류가 해결 됐습니다