【发布时间】:2018-12-18 07:43:14
【问题描述】:
我正忙着分析tensorflow BERT code,看看它对于特定用例是否足够快。
我需要确定预测的速度。现在,据我了解,可以将profiler 或run_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