使用cloudml训练R Keras模型失败

时间:2018-07-07 06:50:06

标签: r keras google-cloud-ml

我才刚刚开始使用R进行深度学习,并试图弄清楚如何使用cloudml软件包在Google Cloud GPU上训练keras模型。

我从这里一直在研究Nietzsche文本生成示例- https://keras.rstudio.com/articles/examples/lstm_text_generation.html-并且它在我的本地计算机上运行良好,但是不幸的是,当我尝试使用cloudml软件包运行它时,它无法正确执行。

我将示例代码保存为“ nietzsche_eg.R”,然后运行以下代码-

library (cloudml)

options (gcloud.binary.path="C:/Users/taman/AppData/Local/Google/CloudSDK/google-cloud-sdk/bin/gcloud")
options (gsutil.binary.path="C:/Users/taman/AppData/Local/Google/CloudSDK/google-cloud-sdk/bin/gsutil")

cloudml_train ("nietzsche_eg.R", master_type = "standard_p100")

不幸的是,我收到以下错误-

Error: ValueError: Layer lstm_1 was called with an input that isn't a symbolic tensor. Received type: <class 'keras.engine.sequential.Sequential'>. Full input: [<keras.engine.sequential.Sequential object at 0x7f64b3b75610>]. All inputs to the layer should be tensors. Detailed traceback: File "/usr/local/lib/python2.7/dist-packages/keras/layers/recurrent.py", line 500, in __call__ return super(RNN, self).__call__(inputs, **kwargs) File "/usr/local/lib/python2.7/dist-packages/keras/engine/base_layer.py", line 414, in __call__ self.assert_input_compatibility(inputs) File "/usr/local/lib/python2.7/dist-packages/keras/engine/base_layer.py", line 285, in assert_input_compatibility str(inputs) + '. All inputs to the layer ' 

非常感谢您提供任何帮助或了解发生了什么问题。谢谢!

1 个答案:

答案 0 :(得分:0)

您正在从Google云端存储中读取输入文本文件,而不是通过http,不是吗?处于困境的工作人员无法在Google数据中心之外进行联系。