tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

tf.summary.trace_export( name="my_func_trace", step=0, profiler_outdir=logdir) Cannot stop profiling. No profiler is running.

Open RayGuo-C opened this issue 5 years ago • 6 comments

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)

RayGuo-C avatar Jan 07 '21 13:01 RayGuo-C

Thanks for the report. I can reproduce. I will take a look.

bmd3k avatar Jan 07 '21 18:01 bmd3k

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".

bmd3k avatar Jan 07 '21 19:01 bmd3k

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.

trisolaran avatar Jan 07 '21 23:01 trisolaran

Okay. Thank you very much. It works as you said.

RayGuo-C avatar Jan 08 '21 12:01 RayGuo-C

@RayGuo-C , please confirm if this can be closed.

arghyaganguly avatar Mar 04 '21 11:03 arghyaganguly

Fix is now available in 2.4.1.Closing this.

arghyaganguly avatar Apr 16 '21 04:04 arghyaganguly