반응형

CUDA 4

[Pytorch] Load state_dict로 인한 out of memory

back = Back().cuda() state_dict = torch.load(config['back_init_model']) back.load_state_dict(state_dict['state_dict']) 모델을 GPU에 올린뒤에 load 명령어로 state_dict 파일을 불러오고 모델.load_state_dict로 불러온 state_dict을 적용하면 GPU 메모리가 낭비된다. 즉 CUDA out of memory가 발생할 수 있다는 것. load_state_dict이 적용된 모델과 처음에 정의한 모델이 함께 GPU에 올라가서 발생한 문제인 것 같다. 먼저 CPU 에 모델을 올리고 나서 load_state_dict으로 state_dict을 적용한 후에 GPU에 올리면 된다. back = Bac..

[에러 해결] CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling `cublasCreate(handle)

pytorch lightning으로 분산학습시에 오류가 발생했다. CUDA error: CUBLAS_STATUS_INTERNAL_ERROR when calling `cublasCreate(handle)` 오류 발생시 해결방법은 pytorch 버전과 cuda 버전을 맞춰줘야 한다 !@ 아래 코드를 입력하면 최신 버전 torch로 업데이트 해준다. 하하하 pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html 출처 https://discuss.pytorch.org/t/cuda-error-cublas-status-internal-error..

[PyTorch 튜토리얼] 파이토치에 대해서 - What is PyTorch

공부 목적으로 파이토치 튜토리얼 홈페이지를 번역해보았습니다. What is PyTorch? — PyTorch Tutorials 1.7.0 documentation Note Click here to download the full example code What is PyTorch? It’s a Python-based scientific computing package targeted at two sets of audiences: A replacement for NumPy to use the power of GPUs a deep learning research platform that provides maximu pytorch.org 파이토치에 대해서 - What is PyTorch? 2개의 집단을 목표로..

반응형