【问题标题】:How to train keras model using Google Cloud TPU如何使用 Google Cloud TPU 训练 keras 模型
【发布时间】:2018-07-24 02:43:15
【问题描述】:

理论上,我们可以在任何支持 Tensorflow 的平台上训练支持 Tensorflow 的 Keras 模型。但是,我似乎在 Google 的文档 https://cloud.google.com/tpu/docs/ 中找不到任何有关如何操作的信息。

【问题讨论】:

    标签: google-cloud-platform keras


    【解决方案1】:

    【讨论】:

    • 谢谢,该示例中似乎仍有相当数量的 Tensorflow 内容。这样的损失函数和优化器。此外,在示例中,Keras 是从“tf.contrib”导入的。我知道 Keras 是由 Google 团队开发的,但是现在推荐使用 Keras 的方式吗?
    • 我也在尝试在 TPU 中重用我的 keras 推理代码,似乎没有简单的方法。
    • 你找到方法了吗?我正在尝试在此 example 旁边使用 tf.keras.applications' 模型。我刚刚用导入tf.keras.applications 模型的函数替换了cnn_model。但我收到错误 NotImplementedError: Operation of type ReadVariableOp (block1_conv1/Conv2D/ReadVariableOp) is not supported on TPU for inference。如果在图中使用此操作,则执行将失败。确保您的变量正在使用 variable_scope。
    猜你喜欢
    • 2019-10-30
    • 2022-01-25
    • 2019-05-25
    • 2021-05-17
    • 2019-10-26
    • 2020-12-10
    • 2019-12-05
    • 1970-01-01
    • 2020-03-31
    相关资源
    最近更新 更多