看啥推荐读物
专栏名称: TensorFlow
Google官方账号,分享人工智能和TensorFlow相关的最新消息、技术资源、活动和实践案例。联系我们:tfchina@google.com
今天看啥  ›  专栏  ›  TensorFlow

TensorFlow 调试程序(二)

TensorFlow  · 公众号  · AI  · 2019-05-16 13:47
调试 TensorFlow Estimator本部分介绍了如何调试使用 Estimator API 的 TensorFlow 程序。这些 API 提供的部分便利性是它们在内部管理 Session。这样一来,上面的部分介绍的 LocalCLIDebugWrapperSession 就不适用了。幸运的是,您仍然可以使用 tfdbg 提供的特殊 hook 调试它们。tfdbg 可以调试 tf-learn Estimator 的 train()、evaluate() 和 predict() 方法。要调试 Estimator.train(),请创建一个 LocalCLIDebugHook 并将其用作 hooks 参数的一部分。例如:# First, let your BUILD target depend on "//tensorflow/python/debug:debug_py"# (You don't need to worry about the BUILD dependency if you are using a pip#  install of open-source TensorFlow.)from tensorflow.python import debug as tf_debug# Create a LocalCLIDebugHook and use it as a monitor when calling fit().hooks = [tf_deb ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照