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?

Windows11 で torch を使った機械学習モデルの pip install -e . ができない

Last updated at Posted at 2024-09-24

覚書き

環境:
Windows 11
Python 3.10
Pytorch 2.4.0

発生したライブラリ

  1. AlphaPose
  2. detectron2
  3. GraoudingDINO

エラーの内容

fatal error LNK1181: 入力ファイル 'C:\Users\Cyberchan\PythonProjects\BehaviorCostumeEditor\GroundingDINO\build\temp.win-amd64-cpython-310\Release\Users\Cyberchan\PythonProjects\BehaviorCostumeEditor\GroundingDINO\groundingdino\models\GroundingDINO\csrc\MsDeformAttn\ms_deform_attn_cpu.obj' を開けません。
    error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe' failed with exit code 1181
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

対処法

1.仮想環境から torch, torchvision, torchaudio の削除

pip uninstall torch torchvision torchaudio

2.ライブラリのインストール

pip install -e .

3.通常使用する pytroch の install

# CUDA 12.1
pip install torch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 --index-url https://download.pytorch.org/whl/cu121
  • 先ほど install したものは uninstall しない
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?