如何使用张量板分析 keras 预测调用 [英] How to profile a keras predict call with tensorboard
本文介绍了如何使用张量板分析 keras 预测调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要预测调用的时间配置文件/跟踪,以估计我的模型执行推理的速度.
I would like to have a timing profile/trace of a predict call to get an estimate of how fast my model can perform inference.
现在我正在使用:
log_dir="logs/profile/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, profile_batch = 1)
x_test, y_test = next(iter(training_ds))
_ = unet.predict(x_test, verbose=1, callbacks=[tensorboard_callback])
但是分析选项卡没有显示在张量板中.我在这里错过了什么?
But the profiling tab does not show up in tensorboard. What am I missing here?
推荐答案
如果您使用的是虚拟环境,请确保不要混淆.请参阅我对另一个问题的回答.
If you are using virtual environments, make sure you don't mix things up. See my answer to another question.
此外,有 4 种方法可以写入分析数据.正如您之前尝试过回调一样,您应该尝试其他方法:分析方法概述.
Also, there are 4 methods to write profiling data. As you tried callbacks before, you should give the other methods a try: Overview of profiling methods.
这篇关于如何使用张量板分析 keras 预测调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文