์ ์ฒด ๊ธ
-
VSCode์์ Docker Container์ Remote๋ก ์ฐ๊ฒฐํ๊ธฐComputer Science/๊ฐ๋ฐ 2024. 6. 6. 16:52
๋์ปค๋ฅผ ์คํ์ํค๊ณ ์ปจํ ์ด๋ ์ํํธ์จ์ด ํ๊ฒฝ์ ์ ์ํ์ฌ ๊ฐ๋ฐํ๋ ๋ฐฉ๋ฒ์ ๋ค๋ฃจ๊ณ ์ ํ๋ค. Extension ์ค์น (Dev Containers) Remote Development๋ผ๋ extension์ ์ค์นํ๋ ค๊ณ ํ๋๋ฐ extension์ ๋์ค์ง ์์์ ๊ทธ๋์ Dev Containers๋ฅผ ์ค์นํ๋ค. F1์ ๋๋ฌ์ ์ผ๋จ 'Remote-SSH: ํธ์คํธ์ ์ฐ๊ฒฐ' ์ ํด์ฃผ๊ณ Dev Containers: Attach to Running Container...๋ฅผ ํด๋ฆญํ์ฌ ์ ์ํ ์ปจํ ์ด๋๋ฅผ ์ ํํด์ค๋ค. ๊ทธ๋ค์ container์ ์ ์ฅํ code๋ฅผ ์ด๊ธฐ ์ํด ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ ๋ ฅํด์ฃผ๋ฉด ์ด๋ํ ์ ์๋ค.
-
Docker ์ค์น๋ถํฐ ์ด๋ฏธ์ง ๋น๋, ์คํ๊น์ง ๐Computer Science/๊ฐ๋ฐ 2024. 6. 6. 02:08
์ด์ ํฌ์คํธ์์ mmsegmentation ๋ฒ์ ๋ฌธ์ ๊ฐ ์์๋ค.๊ทธ๋ฌ๋๊น Github ๋ ํฌ์งํ ๋ฆฌ์ ์ด๋ค ์ฝ๋๋ฅผ ์คํ์์ผ์ผ ํ๋๋ฐ PyTorch 1.x.0๊ณผ Cuda 11.6 ๋ฒ์ ๋ง์ ์ง์ํ๋ ์ฝ๋์๋ค. ๊ทธ๋ฐ๋ฐ ์๋ฒ(base machine)์ ์ค์น๋ cuda ๋ฒ์ ์ 12.1์ด์๊ธฐ ๋๋ฌธ์ ํธํ๋๋ Pytorch ๋ฒ์ ๋ 2.0.1 ์ด์ด์ ๋๋ค ์์กด์ฑ ๋ฌธ์ ๊ฐ ์์๋ค. Base machine cuda, torch ๋ฒ์ ์์ผ๋ก๋ ํ๋ก์ ํธ ๋ณ๋ก cuda ๋ฒ์ ์ ๋ค๋ฅด๊ฒ ์ฌ์ฉํ๋ ์ผ์ด ๋ฒ๋ฒ์ด ๋ฐ์ํ ๊ฒ ๊ฐ์์ ํด๊ฒฐ์ฑ ์ผ๋ก docker๋ฅผ ์ฌ์ฉํด๋ณด๊ธฐ๋ก ํ๋ค. ๋์ปค๋ ์ปจํ ์ด๋๋ณ๋ก ๋ค๋ฅธ ๋ฒ์ ์ cuda๋ฅผ ์ฌ์ฉํ ์ ์๊ณ , base machine์ GPU๋ ๊ทธ๋๋ก ์ฌ์ฉํ ์ ์์ผ๋ฉฐ Docker Hub์์ ์ํ๋ ๋์ปค ์ด๋ฏธ์ง๋ฅผ Pul..
-
ModuleNotFoundError: No module named 'mmcv._ext'Computer Science/๊ฐ๋ฐ 2024. 5. 25. 14:46
mmcv-full๊ณผ mmsegmentation ์ค์น๋ฅผ ํ ๋ ์๋์ ๊ฐ์ด ์งํํ๋ค.pip install mmcv-full==1.3.0 mmsegmentation==0.11.0 ๊ทธ๋ฐ๋ฐ train ์ฝ๋๋ฅผ ์คํํ๋๋ฐ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ด๋ค.ModuleNotFoundError: No module named 'mmcv._ext' ์์น๋ฅผ ํด๋ณธ ๊ฒฐ๊ณผ mmcv๋ฅผ uninstall ํ๊ณ ๋ค์ mmcv-full์ ์ค์นํ์ฌ ํด๊ฒฐํ๋ค๋ ๊ธ์ ๋ณด๊ณ pip uninstall mmcv๋ฅผ ํ์ง๋ง warning ๋ฌธ๊ตฌ๊ฐ ๋จ๋ฉด์ uninstall์ด ์๋์๋ค. ๊ทธ๋์ ๊ทธ๋ฅ ๊ฐ์ํ๊ฒฝ์ ์๋ก ๋ง๋ค๊ณ torch ์ค์น๋ถํฐ mmcv, mmsegmentation์ ๋ค์ ์ค์นํ๊ธฐ๋ก ํ๋ค. mmcv ๊ณต์ ๋ฌธ์๋ฅผ ๋ณด๋ installation instruc..
-
tensorflow v1Computer Science/๊ฐ๋ฐ 2024. 4. 23. 14:49
์ค์น ๊ฐ๋ฐํ๊ฒฝ: Ubuntu 20.04.6 LTS 1. conda create -n tfv1 python=3.7 (3.8๋ถํฐ๋ v1 ์ค์น๊ฐ ์ง์๋์ง ์๋๋ค) 2. python -m pip install --upgrade pip 3. pip3 install tensorflow==1.15.2 (ํด๋น tensorflow๋ cpu์ฉ์) 4. python3 >> import tensorflow as tf >> print(tf.__version__) 1.15.2 Basic TensorFlow code (v1) N, D, H = 64, 1000, 1000 # ๋ฐฐ์น, ์ฐจ์, ๋ ธ๋ x = tf.placeholder(tf.float32, shape=(N,D)) y = tf.placeholder(tf.float32, sha..
-
ํ์ด์ฌ ๋ฉ์๋ ์ด๋ฆ ์์ ์ธ๋์ค์ฝ์ด('_') ์๋ฏธComputer Science/๊ฐ๋ฐ 2024. 3. 11. 15:43
ํจ์๋ ๋ฉ์๋ ์ด๋ฆ ์์ ์ธ๋์ค์ฝ์ด('_') ํ๋๊ฐ ๋ถ๋ ๊ฒ์ ์ผ๋ฐ์ ์ผ๋ก ๊ทธ ํจ์๋ ๋ฉ์๋๊ฐ ๋ด๋ถ์ (Internal)์ผ๋ก ์ฌ์ฉ๋๋ ๊ฒ์์ ๋ํ๋ธ๋ค. ์ด๋ฌํ ๊ท์น์ ํ์ด์ฌ์ ๋ค์ด๋ฐ ์ปจ๋ฒค์ ์์ ๋น๋กฏ๋ ๊ฒ์ผ๋ก ๋ค์๊ณผ ๊ฐ์ ์๋ฏธ๋ฅผ ๊ฐ์ง๋ค. 1. ๋ด๋ถ ์ฌ์ฉ์ ์ํ ๊ฒ: ์ด๋ ํด๋น ํจ์๋ ๋ฉ์๋๊ฐ ํด๋์ค๋ ๋ชจ๋์ ๋ด๋ถ ๊ตฌํ์ ์ํ๋ฉฐ, ํด๋์ค๋ ๋ชจ๋ ์ธ๋ถ์์ ์ง์ ์ ์ผ๋ก ์ฌ์ฉ๋๊ธฐ๋ณด๋ค๋ ํด๋์ค๋ ๋ชจ๋ ๋ด๋ถ์์ ์ฌ์ฉ๋ ๊ฒ์์ ์๋ฏธํฉ๋๋ค. ๋ค์ ๋งํด, ์ด๋ ์ผ์ข ์ ๊ตฌํ ์ธ๋ถ์ฌํญ์ ๋ํ๋ด๋ฉฐ, ํด๋์ค๋ ๋ชจ๋์ ๊ณต๊ฐ ์ธํฐํ์ด์ค์ ์ผ๋ถ๊ฐ ์๋๋๋ค. 2. ๋ณดํธ๋ ๋ฉค๋ฒ(protected member): ์ธ๋์ค์ฝ์ด๊ฐ ์์ ๋ถ์ ๋ฉค๋ฒ๋ ํ์ด์ฌ์์ protected member๋ก ๊ฐ์ฃผ๋๋ค. ์ด๋ ์๋ธํด๋์ค์์๋ ์ ๊ทผ ๊ฐ๋ฅํ์ง๋ง, ํด๋์ค ์ธ..
-
torch.log_softmaxAI\ML\DL/Pytorch 2024. 3. 11. 14:07
torch.log_softmax ํจ์๋ softmax ํจ์์ log๋ฅผ ์ทจํ ๊ฒ๊ณผ ๊ฐ๋ค. softmax์ Log ๋ ์ฐ์ฐ์ ๋ฐ๋ก ์ํํ๋ ๊ฒ๋ณด๋ค log_softmax๋ฅผ ํตํด ํ๋ฒ์ ์ํํ๋ ๊ฒ์ด ๋ ๋น ๋ฅด๊ณ ์์น์ ์ผ๋ก ์์ ์ ์ด๋ผ๊ณ ํ๋ค. ์ ์ฝ๋๋ฅผ ๋ณด๋ฉด ๋๋ค์ผ๋ก ์์ฑํ 3x5 ํ ์ x์ softmax๋ฅผ ์ทจํ๊ณ log๋ฅผ ์ทจํ ๊ฒฐ๊ณผ๋, log_softmax๋ฅผ ์ทจํ ๊ฒฐ๊ณผ๋ ๋์ผํ๋ค๋ ๊ฒ์ ์ ์ ์๋ค. ์ ๋ฆฌํ๋ฉด log_softmax๋ ๋ค์ค๋ถ๋ฅ ๋ฌธ์ ์์ logit์ softmax ์ทจํ ๋ค์ 0๊ณผ 1์ฌ์ด์ ํ๋ฅ ๋ก ๋ณํํ๋ ํจ์์ด๋ค.
-
wandb ์ค์น, ๋ก๊ทธ์ธ์นดํ ๊ณ ๋ฆฌ ์์ 2024. 3. 10. 15:32
๋จธ์ ๋ฌ๋ ์คํ ๊ด๋ฆฌ ํด์๋ TensorBoard, Weights & Biases๊ฐ ์๋ค. ์ค๋์ Weights&Biases์ ๋ํด ์๊ฐํ๋ค. wandb๋ ๋ฅ๋ฌ๋ ์คํ ๊ณผ์ ์์ ์๊ธธ ์ ์๋ ๋ค์ํ ์์น๋ค (์. loss function, metric)์ ํธ๋ฆฌํ๊ฒ ์๊ฐํํ๊ณ ํธ๋ํนํ๊ธฐ ์ข์ ํด์ด๋ค. ์ด๋ฆ์ ์๋ W์ B๋ ๋ฅ๋ฌ๋์์ ํํ ์ฌ์ฉํ๋ W(๊ฐ์ค์น), b(ํธํฅ)์ ๋ปํ๋ค. Weights and biases๋ฅผ ์ค์ฌ์ wandb๋ผ๊ณ ๋ถ๋ฅธ๋ค. wandb๋ฅผ ์ฌ์ฉํ๋ฉด ๋ ๋น ๋ฅธ ๋ชจ๋ธ ๋น๋๊ฐ ๊ฐ๋ฅํ๊ณ , training progress๋ฅผ ๋น ์ง์์ด ์๊ฐํ ๊ฐ๋ฅํ๋ค. - architecture, hyperparameter, weights, model prediction, GPU usage, git commits, ..
-
pip install ๋ช ๋ ์ด ์ต์ ์ ๋ฆฌComputer Science/๊ฐ๋ฐ 2024. 3. 7. 16:00
MacOS, Unix, Linux ๊ธฐ์ค์ผ๋ก pip ์ฌ์ฉ๋ฒ์ ์๋์ ๊ฐ์ด ์ ๋ฆฌํ ์ ์๋ค. pip install [options] [package-index-options] ...pip install [options] -r [package-index-options] ...pip install [options] [-e] ...pip install [options] [-e] ...pip install [options] ... ์ต์ ๋ค-r : r์ requirement๋ผ๋ ์๋ฏธ๋ก, requirements.txt ํ์ผ์ ์ง์ ๋ ํจํค์ง๋ค์ ์ค์นํ๋ค. ํน์ ํจํค์ง ๋ฒ์ ์ผ๋ก ํ๊ฒฝ์ ์ค์ ํ ๋ ์์ฃผ ์ฌ์ฉํ๋ค.-e : e๋ editable์ ์๋ฏธ๋ก, ํจํค์ง๋ฅผ ํธ์ง ๊ฐ๋ฅํ ๋ชจ๋๋ก ์ค์นํ๋ค. path ์์น์ '.' ..