1
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?

More than 5 years have passed since last update.

Jetson NanoでChainerのDCGANサンプルを動かす試み

Posted at

はじめに

ChainerがインストールできたのでDCGANのサンプルを動かした(完了したとは言わない)。

準備

最初にソースコードをダウンロードしexsamplesにあるdcganを複製する。

ターミナル
yamamo-to@jetson-nano:~$ cd ~/Documents/Chainer
yamamo-to@jetson-nano:~/Documents/Chainer$ mkdir src
yamamo-to@jetson-nano:~/Documents/Chainer$ cd src
yamamo-to@jetson-nano:~/Documents/Chainer/src$ git clone https://github.com/chainer/chainer.git
yamamo-to@jetson-nano:~/Documents/Chainer/src$ cd ..
yamamo-to@jetson-nano:~/Documents/Chainer$ cp -a src/chainer/examples/dcgan .

次にpillowをインストールする。

ターミナル
yamamo-to@jetson-nano:~/Documents/Chainer$ pipenv install pillow

実行

train_dcgan.pyを実行する。

ターミナル
yamamo-to@jetson-nano:~/Documents/Chainer$ cd dcgan
yamamo-to@jetson-nano:~/Documents/Chainer/dcgan$
yamamo-to@jetson-nano:~/Documents/Chainer/dcgan$ pipenv run python3 train_dcgan.py --gpu 0
Device: @cupy:0
# Minibatch-size: 50
# n_hidden: 100
# epoch: 1000

epoch       iteration   gen/loss    dis/loss  ................]  0.01%
0           100         1.19205     1.71583     
     total [..................................................]  0.01%
this epoch [#######...........................................] 15.00%
       150 iter, 0 epoch / 1000 epochs
   0.39819 iters/sec. Estimated time to finish: 29 days, 1:29:34.296910.

動くには動いたが・・・、Estimated timeが29日はさすがに止めるべきか、と考えていたら、熱暴走のためか程なくして落ちた。そろそろFANを買わないとダメそうだ。なおGPUはほぼ100%に張り付き電力は12W前後。

おまけ

同じサンプルをGeforce RTX 2080Tiで実行した場合は14時間程度。

ターミナル
$ python train_dcgan.py --gpu 0
Device: @cupy:0
# Minibatch-size: 50
# n_hidden: 100
# epoch: 1000
 
epoch       iteration   gen/loss    dis/loss  ................]  0.01%
0           100         1.22846     1.72645     
0           200         0.995711    1.47174     
0           300         0.901619    1.37142     
     total [..................................................]  0.03%
this epoch [###############...................................] 30.00%
       300 iter, 0 epoch / 1000 epochs
...
   19.606 iters/sec. Estimated time to finish: 14:08:55.287960.
ターミナル
$ nvidia-smi 
Mon May 27 19:24:04 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce RTX 208...  On   | 00000000:01:00.0 Off |                  N/A |
| 53%   71C    P2   244W / 250W |   1010MiB / 10989MiB |    100%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0     21512      C   python                                       999MiB |
+-----------------------------------------------------------------------------+
1
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
1
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?