tf.summary.trace_export( name="my_func_trace", step=0, profiler_outdir=logdir) Cannot stop profiling. No profiler is running.
Win10 tensorflow2.4 When I run the example from the official documentation https://www.tensorflow.org/tensorboard/graphs, it shows that Cannot stop profiling. No profiler is running.
Code:
@tf.function def my_func(x, y): return tf.nn.relu(tf.matmul(x, y))
stamp = datetime.now().strftime("%Y%m%d-%H%M%S") logdir = 'logs/func/%s' % stamp logdir = os.path.join('./logs2')
writer = tf.summary.create_file_writer(logdir)
x = tf.random.uniform((3, 3)) y = tf.random.uniform((3, 3))
tf.summary.trace_on(graph=True, profiler=True)
z = my_func(x, y) with writer.as_default(): tf.summary.trace_export( name="my_func_trace", step=0, profiler_outdir=logdir)
Thanks for the report. I can reproduce. I will take a look.
This was a regression introduced in TF 2.4. It is already fixed in master and we are working to cherrypicked it into 2.4.1.
Edit: "cherrypicked" instead of "backported".
if you don't care about profiler, please set profiler=False at the trace_on call. if you want profiler, use the new profiler api described at https://www.tensorflow.org/guide/profiler.
I will work with release people to make sure the fix is in the patch release.
Okay. Thank you very much. It works as you said.
@RayGuo-C , please confirm if this can be closed.
Fix is now available in 2.4.1.Closing this.