LoginSignup
7
8

More than 5 years have passed since last update.

pytorchでマルチGPU

Last updated at Posted at 2017-10-16

pytorchでGPU2つ以上使う方法
日本語で書いてる記事が少なかったから投稿

multiGPU.py
import torch.nn as nn

#modelの定義した後に
model = nn.DataParallel(model).cuda()

modelにAlexnetなりResnetなりを読み込ませた後nn.DataParallelでラップしてあげるだけでマルチGPU使用可能

7
8
1

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
7
8