0

我正在訓練CNN來使用Tensorflow對CIFAR-10數據集進行分類。我上的AWS p2.xlarge實例(1個GPU,4個vCPU,61GB RAM),運行06_CIFAR-10.ipynb Jupyter筆記本。我使用Ubuntu 14 Tensorflow AMI進行設置。如何充分利用資源

訓練需要很長時間。當我檢查系統資源時,我發現大部分資源仍然可用。

$ free -h 
     total  used  free  shared buffers  cached 
Mem:   59G  3.5G  56G  15M  55M  854M 
-/+ buffers/cache:  2.6G  57G 
Swap:   0B   0B   0B 


$ top 
top - 18:10:47 up 1:53, 1 user, load average: 0.47, 0.63, 0.69 
Tasks: 134 total, 1 running, 133 sleeping, 0 stopped, 0 zombie 
%Cpu(s): 19.1 us, 4.6 sy, 0.0 ni, 73.2 id, 0.0 wa, 0.0 hi, 0.3 si, 2.8 st 
KiB Mem: 62881764 total, 3695184 used, 59186580 free, 56792 buffers 
KiB Swap:  0 total,  0 used,  0 free. 875028 cached Mem 

    PID USER  PR NI VIRT RES SHR S %CPU %MEM  TIME+ COMMAND                      
2282 ubuntu 20 0 0.099t 2.192g 202828 S 248.2 3.7 141:55.88 python3                      


$ nvidia-smi 
Sat May 6 18:12:28 2017  
+------------------------------------------------------+      
| NVIDIA-SMI 352.99  Driver Version: 352.99   |      
|-------------------------------+----------------------+----------------------+ 
| GPU Name  Persistence-M| Bus-Id  Disp.A | Volatile Uncorr. ECC | 
| Fan Temp Perf Pwr:Usage/Cap|   Memory-Usage | GPU-Util Compute M. | 
|===============================+======================+======================| 
| 0 Tesla K80   On | 0000:00:1E.0  Off |     0 | 
| N/A 54C P0 67W/149W | 11012MiB/11519MiB |  54%  Default | 
+-------------------------------+----------------------+----------------------+ 

+-----------------------------------------------------------------------------+ 
| Processes:              GPU Memory | 
| GPU  PID Type Process name        Usage  | 
|=============================================================================| 
| 0  2282 C /usr/bin/python3        10954MiB | 
+-----------------------------------------------------------------------------+ 

如何檢測瓶頸?並且,有什麼建議可以利用所有系統資源?

+0

關於你的第一個問題:http://stackoverflow.com/questions/34293714/can-i-measure-the-execution-time-of-individual-operations-with-tensorflow/43692312#43692312 – user1735003

回答

0

有一些技巧和改進,你可以達到很高的性能,如確保您使用的是高性能的輸入管道,並充分利用軟件流水線技術。不幸的是,沒有關於特定設置的信息,我無法進一步診斷。

有關背景閱讀(技巧和技術來提高性能),請參閱:

我建議首先是tensorflow基準,是腳本開源並可在:https://github.com/tensorflow/benchmarks