![공부하며 성장하기/Fixing Errors](https://blog.kakaocdn.net/dn/bPvCxr/btrEuWEVlXC/jH57Ym0L2TRGObmd6kDnDk/img.jpg)
공부하며 성장하기/Fixing Errors
![Docker Desktop shutting down 해결](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdzZYY0%2FbtsE95g1rQ1%2F5lSxOrf2mjvtkZMYkeAEI0%2Fimg.png)
Docker Desktop shutting down 해결
Docker desktop을 업데이트하고 난 후부터는 실행이 되지 않았다. 삭제 - 재설치할 때, backend를 hyper-v로 바꾸면 실행은 가능했다. 하지만 근본적인 해결책은 아니었다. 막상 실행하고자 하는 container들을 실행하는 데 한계가 있었다. 예를 들면 nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1 같은 에러가 발생했다. 열심히 검색해보니 이 error는 wsl 기반에서는 발생하지 않는 것 같았다. nvidia-container-cli: initialization error: load library failed: libnvidia-ml.so.1 · Issue #154 · NVIDIA/..
![Loss function returned Nan values 해결](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FFLw7b%2FbtsBCayKszg%2FwxVRTKQKTFkWq5dtXPEfv0%2Fimg.png)
Loss function returned Nan values 해결
직접 model architecture와 dataset, loss function을 만들고 학습시키려고 보니 loss function returned Nan values와 같은 에러가 발생했습니다. 아래와 같은 순서대로 어디서부터 문제가 발생했는지 확인하고, 해결할 수 있었습니다. 1. Learning rate 줄여보기 Learning rate이 너무 크면 모델이 loss function의 minimum value로 optimize되지 못하고 oscillate / overshoot 할 수 있습니다. 따라서 안정적으로 converge하도록 하려면 더 작은 learning rate으로 조정해볼 필요가 있습니다. ex) 0.001 → 0.0001 2. Model architecture 또는 parameter ..
![AWS ECR 이미지와 lambda로 딥러닝 Serverless 서비스 만들기 - UnicodeDecodeError 해결](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fba76sD%2FbtsjO1Fn1b0%2Fj5MllVrscZNGarS4SwxTsk%2Fimg.png)
AWS ECR 이미지와 lambda로 딥러닝 Serverless 서비스 만들기 - UnicodeDecodeError 해결
Error message: Traceback (most recent call last): File "/var/runtime/bootstrap.py", line 60, in main() File "/var/runtime/bootstrap.py", line 55, in main add_default_site_directories() ... 중략 ... File "/var/lang/lib/python3.9/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: ..
![torch.load 시 _pickle.UnpicklingError: invalid load key 해결](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FB9Xpt%2FbtrPReggiY5%2FQmlf2bkfuX0fk04q9h9OX1%2Fimg.jpg)
torch.load 시 _pickle.UnpicklingError: invalid load key 해결
저장해뒀던 모델(.pt 파일)을 불러오려고 할 때 다음과 같은 에러가 발생할 때가 있습니다. model = torch.load(weights, map_location=device) File "작업 경로\venv\lib\site-packages\torch\serialization.py", line 713, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "작업 경로\venv\lib\site-packages\torch\serialization.py", line 920, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_..
![requirements.txt에서 URL로 PyTorch 설치하기](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FTcQ8A%2FbtrMBr5VpiE%2FzLJy2jQNXfvaxsBkz5LtH0%2Fimg.png)
requirements.txt에서 URL로 PyTorch 설치하기
torch를 설치할 때 보통 여기서 다음 명령을 복사해 설치한다. pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 그런 다음 pip freeze > requirements.txt로 다음과 같은 requirements.txt 파일을 만들 수 있다. # requirements.txt albumentations==1.3.0 numpy==1.23.3 pytorch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0+cu113 하지만 이를 그대로 다시 pip install -r requirements.txt로 설치하면 다음과 같은 에..
![torch.cuda.is_available() False 해결](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FPq7Vf%2FbtrEu8sdiCO%2FykgaPRALABEbqH6SRD8Mc1%2Fimg.png)
torch.cuda.is_available() False 해결
GPU가 정상 인식되지 않는 데에는 여러 가지 이유가 있을 수 있지만, 그 중 대부분은 버전 호환 문제입니다. 아래 4가지의 버전을 모두 확인해서 서로 호환이 가능한지 확인해야 합니다. 1. pytorch, torchvision, torchaudio PyTorch An open source machine learning framework that accelerates the path from research prototyping to production deployment. pytorch.org 2. CUDA Release Notes :: CUDA Toolkit Documentation Beginning in 2022, the NVIDIA Math Libraries official hardware sup..