microsoft / vscode-tensorboard

Launch and view Tensorboards in VS Code
MIT License
4 stars 3 forks source link

can not pick up the most recent log, graph and profile #24

Open Ellen-Gu opened 7 months ago

Ellen-Gu commented 7 months ago

Environment data

Expected behaviour

The refresher is set to update every 30 seconds. However, the refresher cannot pick up the new log/graph/profile after the tensorboard plugin is launched. The tensorboard running independently and outside vscode can get all updates.

Actual behaviour

The refresher tried to update ( the turning around arrow moves) but the logs etc after the lauching keep missing.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. test code to get graph/profile for a tf.function:

import tensorflow as tf, numpy as np

@tf.function def my_func(x): y = x * x z = tf.sqrt(y) return z x = tf.constant([1., 2., 3.]) y = my_func(x)

writer = tf.summary.create_file_writer('/home/sharedspace/test/log') with writer.as_default(): tf.keras.backend.set_learning_phase(0) # Make sure we're in evaluation mode tf.summary.trace_on(graph=True, profiler=True) y = my_func(x) tf.summary.trace_export('my_func_graph',profiler_outdir='/home/sharedspace/test/log', step=0) #, profile_timeline=False

!tensorboard --logdir "/home/sharedspace/test/log" --bind_all

no need above. from now on use vscode's Tensorboard plugin <-- navigate to the folder if not current folder

In a new cell call the following magic, or ctrl+shift+p to select Python: Launch TensorBoard

%load_ext tensorboard Screenshot from 2024-04-12 23-51-43 Screenshot from 2024-04-13 00-23-35