トップ 差分 一覧 ソース 検索 ヘルプ RSS ログイン

tips-PyTorch

  PyTorch

にてpip の Linux の CPU ( ノート用なので)にインストールコマンドを作る。。

pip3 install torch==1.11.0+cpu torchvision==0.12.0+cpu torchaudio==0.11.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

(0031100) [green@localhost 250211]$ ./0031100/bin/pip3 install torch==2.4.0+cpu torchvision==0.19.0+cpu torchaudio==2.4.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html

が作られたのコレをベースに使ってゆく

> pip3.11 install --upgrade pip setuptools wheel cmake cython 
> pip3.11  install --upgrade Cython PyYAML wheel matplotlib pillow onnxruntime TensorFlow-cpu opencv-python opencv-contrib-python
> pip3.11 install timm

Multi process (CPU)

==

import torch.multiprocessing as mp

num_processes = 4
model = MyModel()
model.share_memory()
processes = []
for rank in range(num_processes):
   p = mp.Process(target=train, args=(model,))
   p.start()
   processes.append(p)
for p in processes:
  p.join()

Annotation Tool