일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ubuntu
- 프로그래머스
- 핑거스타일
- Numpy
- 컨테이너
- paramiko
- YOLO
- 채보
- pandas
- pip
- OpenCV
- Selenium
- Docker
- pytorch
- windows forms
- VS Code
- Python
- label
- 오류
- error
- C
- Linux
- SSH
- C#
- mysql
- nvidia-smi
- JSON
- 기타 연주
- Visual Studio
- C++
- Today
- Total
목록2025/05 (2)
기계는 거짓말하지 않는다
Windows 환경에서 multiprocessing(DataLoader의 num_workers>0)이 내부적으로 프로세스를spawn(push)할 때 발생 할 수 있는 오류의 예이다.EOFError: Ran out of input...ForkingPickler(file, protocol).dump(obj)_pickle.PicklingError: Can't pickle at 0x0000029A93FCF820>: attribute lookup on __main__ failed익명 함수(lambda)나 로컬 함수 등 피클로 직렬화할 수 없는 객체를 읽어 들이려 하기 때문이다num_workers=0으로 설정하면 해결은 되지만 여러 workers를 사용하여 데이터를 읽으려 할 때는 이렇게 할 수 없다.아래는 W..
딥러닝 실험을 할 때, 결과의 재현성은 매우 중요하다. 실험의 일관성을 유지하기 위해서는 동일한 조건에서 실험을 반복할 수 있어야 한다. 이를 위해 랜덤 시드를 고정하는 방법을 사용할 수 있고, 아래는 랜덤 시드를 고정하는 함수와 모델을 로드하는 예시이다.import torchimport randomimport numpy as npdef set_seed(seed=42): random.seed(seed) # random module 시드 고정 np.random.seed(seed) # numpy 랜덤 시드 고정 torch.manual_seed(seed) # PyTorch CPU 랜덤 시드 고정 torch.cuda.manual_seed_all(seed) # 멀티 GPU 환경 동일..