Skip to content


apapap edited this page Dec 16, 2018 · 8 revisions

How do I use TensorBoard in CoCalc?

Here's a step-by-step tutorial.

  1. Use TensorFlow as usual to train a model and put the output in a log directory. Create a new Terminal by clicking "+New", then Terminal. There are many ways to train a TensorBoard model and tons of tutorials.

    In order to get a quick canonical example running, do this:

~$ wget 
~$ python3 

(NOTE: You must have the project network access upgrade, or the wget above will hang.)

  1. Start TensorBoard in another Terminal, point it to the log file for the model you are training above, by typing
~$ tensorboard --logdir=/tmp/tensorflow/mnist
TensorBoard 0.4.0rc3 at http://project-4a5f0542-5873-4eed-a85c-a18c706e8bcd:6006 (Press CTRL+C to quit)
  1. Once TensorBoard starts, you can view your beautiful TensorBoard server running at

where you have to replace 4a5f0542-5873-4eed-a85c-a18c706e8bcd by your project_id, which can see in your browser URL or in project settings. Don't forget to add the trailing slash!

Note that your TensorBoard viewer will only be available to collaborators on your project, not anybody in the world.

Be sure the version of TensorBoard you're using is compatible with the version of TensorFlow for your Jupyter kernel. For example, currently (December 2018) if the kernel for your notebook is Python 3 (Anaconda 5), you might need to specify a version of TensorBoard that is not the first one in your PATH:

~$ which tensorboard
~$ anaconda5
(base) ~$ which tensorboard
(base) ~$ tensorboard --logdir=/home/user/tftest_logs/
TensorBoard 1.9.0 at http://project-3b9a2993-7ae8-46bd-a4e0-7c5fcc299d78:6006 (Press CTRL+C to quit)
Clone this wiki locally
You can’t perform that action at this time.