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?

Cellpose 3.1.1.1のWindows 11へのインストール

Last updated at Posted at 2025-04-13

Cellpose インストール手順(経験談)

環境

  • OS: Windows 11
  • Anaconda prompt: インストール済み
  • GPU: Quadro RTX 4000
  • Cellpose: 未インストール

手順

以下は、私が実際に試した際に成功した方法です。

  1. NVIDIAドライバを最新にする

  2. Anacondaのbase環境から新しい環境を作成

    conda create --name cellpose python=3.11
    
  3. 作成した環境にCellposeをインストール

    python -m pip install cellpose[gui]
    
  4. torchをアンインストール

    pip uninstall torch
    
  5. PyTorchのGPU対応バージョンをインストール

    • PyTorch公式サイトからCUDA 11.8対応のバージョンを選択。今回は以下のコマンドを実行。
    pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
    
  6. Cellposeを起動する

    python -m cellpose
    

詰まったところと解決した内容

1. ドライバ更新前の問題(CUDA 11.0の場合)

ドライバが古い(CUDA 11.0)状態では、torchはGPUを認識するものの以下のエラーが発生した。

try:
    device = torch.device("cuda:0")
    x = torch.zeros((1,1)).to(device)
    print("CUDA is working on device:", torch.cuda.get_device_name(0))
except Exception as e:
    print("Error using CUDA:", e)

エラー内容:

Error using CUDA: CUDA error: out of memory

→ ドライバを最新のものに更新することで解決。

2. Cellpose公式推奨インストール方法でGPU対応版が入らない

Cellposeの公式GitHubのReadmeにある以下の方法では、GPU対応版がインストールされなかった。

conda install pytorch pytorch-cuda=11.6 -c pytorch -c nvidia

→ PyTorchの公式サイトから直接対応するCUDAバージョンを選択してインストールすることで解決。


以上が私の環境での成功事例です。

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?