【问题标题】:Profiling Tensorflow Estimators分析 TensorFlow 估计器
【发布时间】:2018-12-18 07:43:14
【问题描述】:

我正忙着分析tensorflow BERT code,看看它对于特定用例是否足够快。

我需要确定预测的速度。现在,据我了解,可以将profilerrun_metadata 对象添加到session.Run 选项。但是,BERT 正在使用新的 Estimator API。

如何描述 Estimators?那可能吗?

更新:

Tensorflow 团队向我展示了 here,可以将 ProfilerHook 附加到估算器:

hooks = [tf.train.ProfilerHook(save_steps=1, output_dir=model_dir)]
estimator.predict(..., hooks=hooks)

这会生成一个跟踪文件,但该跟踪不起作用。

Error : Couldn't create an importer for the provided eventData.
at Import.createImporter_ (chrome://tracing/tracing.js:1300:2071)
at addImportStage (chrome://tracing/tracing.js:1295:167)
at Task.run (chrome://tracing/tracing.js:2307:95)
at runAnother (chrome://tracing/tracing.js:2310:371)
at runTask (chrome://tracing/tracing.js:2286:57)
at processIdleWork (chrome://tracing/tracing.js:2291:116)
at window.requestIdleCallback.timeout (chrome://tracing/tracing.js:2284:81)

【问题讨论】:

    标签: python tensorflow profiling


    【解决方案1】:

    如果您使用了类型为timeline-.js 的tf.estimator 文件,将被创建。在 chrome://tracing/ 中加载任何这些时间线-.js 以查看跟踪文件 您将在模型目录中找到timeline-.js 文件。

    【讨论】:

    • 可以+1,但是你需要把这些文件放在哪里,这样你就可以在tensorboard中看到它们了。
    猜你喜欢
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 2019-05-04
    • 1970-01-01
    • 2018-07-06
    • 2018-06-15
    • 2019-12-27
    • 2019-01-04
    相关资源
    最近更新 更多