2017-02-02 13 views
2

Tensorflowを使用してMLモデルを高速化するためにGoogle Cloud MLをテストしています。Google Cloud MLはGPUをサポートしていますか?

残念ながら、Google Cloud MLは非常に遅いようです。私のメインストリームレベルのPCは、Google Cloud MLよりも少なくとも10倍高速です。

私はそれがGPUを使用するのか疑問に思っています。私はテストを行いました。サンプルcodeをGPUを使用して強制的に修正しました。

diff --git a/mnist/trainable/trainer/task.py b/mnist/trainable/trainer/task.py 
index 9acb349..a64a11d 100644 
--- a/mnist/trainable/trainer/task.py 
+++ b/mnist/trainable/trainer/task.py 
@@ -131,11 +131,12 @@ def run_training(): 
    images_placeholder, labels_placeholder = placeholder_inputs(
    FLAGS.batch_size) 

- # Build a Graph that computes predictions from the inference model. 
- logits = mnist.inference(images_placeholder, FLAGS.hidden1, FLAGS.hidden2) 
+ with tf.device("/gpu:0"): 
+  # Build a Graph that computes predictions from the inference model. 
+  logits = mnist.inference(images_placeholder, FLAGS.hidden1, FLAGS.hidden2) 

- # Add to the Graph the Ops for loss calculation. 
- loss = mnist.loss(logits, labels_placeholder) 
+  # Add to the Graph the Ops for loss calculation. 
+  loss = mnist.loss(logits, labels_placeholder) 

    # Add to the Graph the Ops that calculate and apply gradients. 
    train_op = mnist.training(loss, FLAGS.learning_rate) 

このトレーニング・コードは、私のPC(gcloud beta ml local train ...)ではなく、クラウドで動作します。

"Traceback (most recent call last): 
    File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main 
    "__main__", fname, loader, pkg_name) 
    File "/usr/lib/python2.7/runpy.py", line 72, in _run_code 
    exec code in run_globals 
    File "/root/.local/lib/python2.7/site-packages/trainer/task.py", line 239, in <module> 
    tf.app.run() 
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run 
    sys.exit(main(sys.argv[:1] + flags_passthrough)) 
    File "/root/.local/lib/python2.7/site-packages/trainer/task.py", line 235, in main 
    run_training() 
    File "/root/.local/lib/python2.7/site-packages/trainer/task.py", line 177, in run_training 
    sess.run(init) 
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 766, in run 
    run_metadata_ptr) 
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 964, in _run 
    feed_dict_string, options, run_metadata) 
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1014, in _do_run 
    target_list, options, run_metadata) 
    File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1034, in _do_call 
    raise type(e)(node_def, op, message) 
InvalidArgumentError: Cannot assign a device to node 'softmax_linear/biases': Could not satisfy explicit device specification '/device:GPU:0' because no devices matching that specification are registered in this process; available devices: /job:localhost/replica:0/task:0/cpu:0 
Colocation Debug Info: 
Colocation group had the following types and devices: 
ApplyGradientDescent: CPU 
Identity: CPU 
Assign: CPU 
Variable: CPU 
    [[Node: softmax_linear/biases = Variable[container="", dtype=DT_FLOAT, shape=[10], shared_name="", _device="/device:GPU:0"]()]] 

Google Cloud MLはGPUをサポートしていますか?

答えて

3

GPUは現在ベータ版になっており、すべてのクラウドMLのお客様はアクセスできます。

ここには、Cloud MLでGPUを使用するためのdocsがあります。

+0

運が良ければ良いですか?私はGPUを指定して自分の仕事を実行しようとすると、ジョブは単にキューに座っている... '' ' のgcloudベータmlのジョブが --stagingバケット\ --package-パス=電車\訓練gpu_job_basic_gpuを提出します= "$ {STAGING_BUCKET}" \ - モジュール名= train.1-乗算\ --region = us-central1 \ --scale-tier = BASIC_GPU '' ' – eggie5

+0

領域us-east1を試してください。 –

+0

うわー。文書が明らかに中央がうまくいかなければならないと明言したときに、東を試してみる直感は何でしたか? – eggie5

関連する問題