trainNetworkで共有GPUメモリを使用する方法
61 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
セマンティックセグメンテーションのニューラルネットのトレーニングにおいて、共有GPUメモリを使用する方法を教えてください。 共有GPUメモリが使用されないため、ミニバッチを大きくするとすぐにメモリ不足になってしまいます。
コード例:
options = trainingOptions('sgdm', ...
'Momentum', 0.9, ...
'InitialLearnRate', 1e-3, ...
'L2Regularization', 0.0005, ...
'MaxEpochs', 30, ...
'MiniBatchSize', 2, ...
'Shuffle', 'every-epoch', ...
'ExecutionEnvironment', 'auto', ...
'VerboseFrequency', 2);
augmenter = imageDataAugmenter('RandXReflection',true,...
'RandXTranslation', [-10 10], 'RandYTranslation',[-10 10]);
datasource = pixelLabelImageSource(imdsTrain,pxdsTrain,...
'DataAugmentation',augmenter);
[net, info] = trainNetwork(datasource,lgraph,options);
システム構成:
- OS: Windows 10 pro for Workstations 64bit (10.0, ビルド 16299)
- Matlab: 2018a
- GPU: NVIDIA Quadro K620
- Cuda 9.2, V9.2.88
- Neural Network Toolbox: バージョン 11.1 (R2018a)
- Parallel Computing Toolbox: バージョン 6.12 (R2018a)
トレーニング中のGPU使用状況の様子:
0 commentaires
Réponses (1)
Etsuo Maeda
le 21 Mai 2018
共有GPUメモリを使う機能はありません。 仮に、共有GPUメモリを使えたとしても、計算速度は数桁低下します。 共有GPUメモリは、Windowsがメインメモリ上に割り当てた共有領域であり、当然ながら応答速度はメインメモリと同様です。
ミニバッチサイズを大きくすることが目的であり、速度を全く気にしないのであれば、GPU計算をせず、メインメモリを大量に積んだ状態でCPUで計算をしてください。 ミニバッチサイズを大きくし、かつ高速に計算したい場合は、NVIDIA社のTESLAシリーズが推奨されます。
0 commentaires
Voir également
Catégories
En savoir plus sur GPU 計算 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!