์ฝ๋ฉ์ torch, cuda ์ฌ์์ ์๋์ ๊ฐ๋ค
import torch
print("torch:", torch.__version__)
print("cuda :", torch.version.cuda)
>>>
torch: 2.9.0+cu126
cuda : 12.6
MMDetectino์ ์คํํ๊ธฐ ์ํด ํ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค์ ์ค์นํด์ฃผ๋ฉด
!pip install -U openmim
!mim install mmengine
Traceback (most recent call last):
File "/usr/local/bin/mim", line 3, in <module>
from mim.cli import cli
File "/usr/local/lib/python3.12/dist-packages/mim/__init__.py", line 10, in <module>
import setuptools # noqa: F401
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/setuptools/__init__.py", line 16, in <module>
import setuptools.version
File "/usr/local/lib/python3.12/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python3.12/dist-packages/pkg_resources/__init__.py", line 2172, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
์๋ ๋ฉ๋๋ค
๊ทธ๋์ ์๋ฒ ์ ํ ํ ๋ torch, cuda ๋ฒ์ ์ ๋ฎ์ถฐ์ ์ค์นํด์ฃผ๊ณ ์งํํ์ ๋ ์ด์์์๋ ๋ฐฉ๋ฒ์ ์ฌ์ฉํด๋ณด์๋ค
uv๋ก ํ๋ก์ ํธ ํ๊ฒฝ ์ ํ ํ๊ธฐ
๋ค์ด๋ฒ ๋ถ์บ ์์ ๋ฆฌ๋ทฐ ๊ฐ์ฑ ๋ถ๋ฅ ์ฑ๋ฆฐ์ง๋ฅผ ํ๋๋ฐ venv ๋์ uv๋ฅผ ์ฌ์ฉํด๋ณด๋ฉด ๋ ๋น ๋ฅด๊ณ ์ข๋ค๊ณ ํด์ ์ด๋ฒ ๊ธฐํ์ ์จ๋ณด๋ คํ๋ค์ ํ ํ๋๋ผ ํท๊ฐ๋ฆฌ๋ ๋ถ๋ถ๋ค์ด ์๊ธฐ๊ธฐ๋ ํด์ ๊ทธ๋ฅ ์ ํ ๊ณผ์ ์ ๊ฐ๋จ
bh-kaizen.tistory.com
# 2. PyTorch 2.1.0 + cu121 ์ค์น (ํ๊ฒฝ ๊ณ ์ )
!pip install torch==2.1.0 --index-url 'https://download.pytorch.org/whl/cu121'
!pip install torchvision==0.16.0 --index-url 'https://download.pytorch.org/whl/cu121'
# 3. ํ๊ฒฝ ํ์ธ
import torch
print("torch:", torch.__version__)
print("cuda :", torch.version.cuda)
>>>
Looking in indexes: https://download.pytorch.org/whl/cu121ERROR: Could not find a version that satisfies the requirement torch==2.1.0
(from versions: 2.2.0+cu121, 2.2.1+cu121,2.2.2+cu121, 2.3.0+cu121, 2.3.1+cu121, 2.4.0+cu121, 2.4.1+cu121, 2.5.0+cu121, 2.5.1+cu121)
ERROR: No matching distribution found for torch==2.1.0
Looking in indexes: https://download.pytorch.org/whl/cu121
ERROR: Could not find a version that satisfies the requirement torchvision==0.16.0 (from versions: 0.1.6, 0.2.0, 0.17.0+cu121, 0.17.1+cu121, 0.17.2+cu121, 0.18.0+cu121, 0.18.1+cu121, 0.19.0+cu121, 0.19.1+cu121, 0.20.0+cu121, 0.20.1+cu121)
ERROR: No matching distribution found for torchvision==0.16.0
torch: 2.9.0+cu126
cuda : 12.6
์๋ ๊ฒ ํด๋น ๋ฒ์ ผ์ ๋ชป์ฐพ๋๋ค๋ฉฐ ์ค์น ์คํจ
DLCV_New/faster_rcnn/kaggle_new/mm_faster_rcnn_train_coco_bccd.ipynb at main · chulminkw/DLCV_New
Contribute to chulminkw/DLCV_New development by creating an account on GitHub.
github.com
MMDetection ์ค์น
- ๊ฐ์ ์์์๋ pip install mmcv-full๋ก mmcv๋ฅผ ์ค์น(์ฝ 10๋ถ ์ ๋์ ์๊ฐ์ด ์์)
- ์ค์ต์ฝ๋๋ pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.13/index.html ๋ก ๋ณ๊ฒฝ(์ค์น์ 12์ด ์ ๋ ๊ฑธ๋ฆผ. 2022.09).
- 2023๋ 4์ 6์ผ ๊ธฐ์ค์ผ๋ก mmdetection์ด 3.0์ผ๋ก upgrade๋จ. ์ค์ต ์ฝ๋๋ mmdetection 2.x ๊ธฐ์ค์ผ๋ฏ๋ก mmdetection 2.x ์์ค์ฝ๋ ์ค์น ํ์.
- 2024๋ 9์ colab์ numpy version์ด 1.24๋ก upgrade๋๋ฉด์ ์ผ๋ถ ์ฝ๋๊ฐ ๋์์ค๋ฅ. numpy 1.23 ์ผ๋ก downgrade ์ ์ฉ
- 2025๋ 1์ 17์ผ Colab์ python ๋ฒ์ ์ด 3.10์์ 3.11๋ก ๋ฒ์ ์ ๋๋ฉด์ pytorch 2.0, torchvision 0.15๋ก ๋ณ๊ฒฝ. mmcv๋ !pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0.0/index.html ๋ก ๋ณ๊ฒฝ.
- 2025๋ 8์ 25์ผ Colab์ python ๋ฒ์ ์ด 3.11์์ 3.12๋ก ๋ฒ์ ์ ๋๋ฉด์ ๋ ์ด์ mmcv-full์ด ์ ๋๋ก ์ค์น ๋์ง ์์.
- ์ด์ Colab ํ๊ฒฝ์์ Kaggle ํ๊ฒฝ์ผ๋ก ์ค์ตํ๊ฒฝ ์ด๊ด. Kaggle์ ์ฌ์ ํ python ๋ฒ์ ์ด 3.11์.
- ๊ธฐ์กด Colab์ ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ๋ /content ๋๋ ํ ๋ฆฌ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ค์ต์ฝ๋ ์ํ๋จ. Kaggle์์๋ /kaggle/working์ด๋ฉฐ ์๋์ผ๋ก ํ์ฌ๋๋ ํ ๋ฆฌ(.)๋ก ์ค์ต ์ฝ๋๋ฅผ ๋ณ๊ฒฝํจ
- 2025๋ 8์ 25์ผ download.openmmlab.com ์ฌ์ดํธ์ ssl ์ด์๋ก pip install ์ --trusted-host ์ต์ ๋ฐ wget์ --no-check-certificate ์ต์ ์ถ๊ฐ
์ดํ.. ํ์ด์ฌ ๋ฒ์ ์ ์ผ๋ก ์ค์น๊ฐ ์๋์ ์ฌ์ฉ์ด ๋ถ๊ฐํ๋ต๋๋ค. ์ฐธ๊ณ ํ๊ธฐ