Closed Alla-Abdella closed 2 years ago
@alla15747 , Can you please provide the information of the Browser you are using?
@rmothukuru Thanks for your responding. my browser is Google chrome.
Hi @alla15747! You can run TensorBoard directly within Colab without needing to configure ngrok or set up any tunnels at all. We have a tutorial on how to do that here:
https://www.tensorflow.org/tensorboard/r2/tensorboard_in_notebooks
For a quick summary:
Make sure that you’re on the latest version of TensorFlow, either the stable branch or the TF 2.0 preview:
# Either:
!pip install -qU tf-nightly # for stable branch
# Or:
!pip install -qU tf-nightly-2.0-preview # for TF 2.0 preview
Load the TensorBoard notebook extensions:
%load_ext tensorboard
Invoke TensorBoard starting with a %
-sign:
%tensorboard --logdir {LOG_DIR}
You don’t need to specify port or host; this will be determined automatically.
Please let us know whether this works for you.
Hi William, Thanks for your time and answer.
Unfortunately, it is not working.
To rephrase my question: First, I'm using Tensorflow and keras. The event file already created in the content colab after I trained my neural network. Now, simply, I just want to read the event file has been created in tensorboard.
Thank you!
The workflow that I described works with TensorFlow and Keras, and works just fine with event files that have already been created in Colab. Your use case is basically exactly what this functionality is for.
You say, “Unfortunately, it is not working”. What’s not working? How?
The workflow that I described works with TensorFlow and Keras, and works just fine with event files that have already been created in Colab. Your use case is basically exactly what this functionality is for.
You say, “Unfortunately, it is not working”. What’s not working? How?
I tried the demo link https://colab.research.google.com/github/tensorflow/tensorboard/blob/master/docs/r2/tensorboard_in_notebooks.ipynb but then i executing '%tensorboard --logdir logs' tensorboard does not show up i using firefox btw
In Firefox, you may need to explicitly enable service workers:
Firefox Nightly: Go to
about:config
and setdom.serviceWorkers.enabled
to true; restart browser.
In my testing, this also works in Firefox 60.6.1esr (no nightly needed).
We’ll add this to the documentation. Thanks for bringing it to our attention.
In Firefox, you may need to explicitly enable service workers:
Firefox Nightly: Go to
about:config
and setdom.serviceWorkers.enabled
to true; restart browser.In my testing, this also works in Firefox 60.6.1esr (no nightly needed).
We’ll add this to the documentation. Thanks for bringing it to our attention.
But, 'dom.serviceWorkers.enabled' is already default to true on my firefox 66.0.3
Hi @alla15747! You can run TensorBoard directly within Colab without needing to configure ngrok or set up any tunnels at all. We have a tutorial on how to do that here:
https://www.tensorflow.org/tensorboard/r2/tensorboard_in_notebooks
For a quick summary:
- Make sure that you’re on the latest version of TensorFlow, either the stable branch or the TF 2.0 preview:
# Either: !pip install -qU tf-nightly # for stable branch # Or: !pip install -qU tf-nightly-2.0-preview # for TF 2.0 preview
- Load the TensorBoard notebook extensions:
%load_ext tensorboard
Invoke TensorBoard starting with a
%
-sign:%tensorboard --logdir {LOG_DIR}
You don’t need to specify port or host; this will be determined automatically.
Please let us know whether this works for you.
ERROR: Failed to launch TensorBoard (exited with 1).
Contents of stderr:
Traceback (most recent call last):
File "/usr/local/bin/tensorboard", line 8, in
@JesminNipu: What you have posted seems unrelated to this issue. It’s a Python package version conflict, which I can’t reproduce on current Colab, and which is not related to service workers. If you continue to experience this issue, please open a new issue and follow the instructions in the issue template: https://github.com/tensorflow/tensorboard/issues/new/choose
@alla15747,
We are checking to see if this is still an issue. Can you try using tensorboard --inspect --event_file=myevents.out
and let us know if that's what you're looking for?. Also you can refer this link for a detailed answer. Thanks!
@alla15747,
Closing this issue due to recent activity. Please reopen the issue if it still persists. Thanks!
I have run a code for a Deep Generative model. And the code generates logs, checkpoints, and events files for Tensorboard:
Example of what shown in the files " Google Colab:
folder: content
.............experiments
.................mnist-experiment
........................checkpoints
........................logs
............................events.out.tfevents.15454....
I want to run the event file "events.out.tfevents.15454...." on Tensorboard in Colab and see the results their.
I tried this code:
You can change the directory name
LOG_DIR = 'tb_logs'
!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip !unzip ngrok-stable-linux-amd64.zip
import os if not os.path.exists(LOG_DIR): os.makedirs(LOG_DIR)
get_ipython().system_raw( 'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &' .format(LOG_DIR))
get_ipython().system_raw('./ngrok http 6006 &')
!curl -s http://localhost:4040/api/tunnels | python3 -c \ "import sys, json; print(json.load(sys.stdin)['tunnels'][0] ['public_url'])" The code opens : inflating: ngrok https://0f1795c4.ngrok.io
However, it's empty. Nothing is shown in the Tensorboard What's missing to run the event file shown in the directory?