%tensorboard line magic in Jupyter Notebook app

Has anyone been able to use the %tensorboard line magic in their Jupyter Notebook app?

When I try it using an example notebook ( Get started with TensorBoard  |  TensorFlow ), I get a timeout. See the screenshot below. I used the --port 0 option to let tensorboard find an unused port on its own.

Using the same tensorboard installation and the same notebook, I’m able to get it working in an Interactive Desktop session. In that case, I start the notebook in a terminal in the desktop session. However, it’s not as convenient as I would like.

This is timing out because tensorboard isn’t aware of the proxying we do through Apache. It looks like this might be solvable through GitHub - jupyterhub/jupyter-server-proxy: Jupyter notebook server extension to proxy web services. - it looks like tensborboard has support for this problem as detailed in this PR: Support jupyter-server-proxy (and other proxies) by zac-hopkinson · Pull Request #3674 · tensorflow/tensorboard · GitHub.