将 tf.Session 重写为 tf.Estimator API

Rewrite tf.Session into tf.Estimator API

我有一些代码是用 tf.Session 低级别 API 编写的,因为我想在 TPU 上使用它,我应该将它重写为 tf.Estimator API 最好,因为有一个 TPUEstimator class 用于 TPU 加速。

是否有执行此操作的标准方法或有关如何处理该操作的指南?

感谢您的帮助!

可以在这里找到一个很好的初始指南:

https://cloud.google.com/tpu/docs/using-estimator-api

此页面的 "TPU Estimator" 部分有更多详细信息:

https://www.tensorflow.org/guide/using_tpu

如果您在阅读这些文档和他们 link 的其他文档后还有其他问题,请提出更详细的问题并使用 google-cloud-tpu 标记它们标签。