0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

condaでMMdetectionの環境構築(cuda 11.8)

Last updated at Posted at 2024-11-13

mmdetection用の環境を作成

mmdetection_envの部分は好きな名前でOK

conda create -n mmdetection_env python==3.8
conda activate mmdetection_env

PyTorchのインストール

cudaのバージョンを確認

nvcc --version

確認したcudaのバージョンに合わせてコマンドを選択
PyTorchのバージョンが2.1.0でないと動かないので注意する

# ROCM 5.6 (Linux only)
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/rocm5.6
# CUDA 11.8
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
# CUDA 12.1
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
# CPU only
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cpu

PyTorchがgpuを認識するか確認

python3
>> import torch
>>print(torch.cuda.is_available())
# Trueなら成功
>> print(torch.cuda.device_count())
# マシンのGPU数と合致していれば成功
>> exit()

mmdetectionのインストール

mmcvのインストール

pip install -U openmim
mim install mmengine
mim install "mmcv==2.1.0"

mmdetのインストール

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
mim install mmdet

参考

PyTorchのインストール

mmdetのインストール

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?