Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Bring TensorBoard to MXNet #4178

Conversation

zihaolucky
Copy link
Member

Hi @piiswrong @mufeili

Thanks to the community, we've made some progress in bringing TensorBoard to MXNet. As mentioned in #4003, we've finished the first step and now we can use TensorBoard without relying on TF, so I open this PR and please review the relevant code. Please check the coding style and relevant docs, anything is welcomed as it's my first time to join an open-source project.

Before I move to next step, build TensorBoard alone, I'll add a notebook example to show its usage :)

@piiswrong
Copy link
Contributor

piiswrong commented Dec 10, 2016

Thanks! This looks great.
looping in others @tqchen @jermainewang @mli

I think its better to have

python
    mxnet
    tensorboard

then

python
    mxnet
        tensorboard

Since we don't want mxnet to depend on protobuf by default.
We can have a make tensorboard option to activate it.
We can also create a separate dmlc/tensorboard repo for this if you want to maintain it.

To be clear, this is only the log writing part right? We still need tensorflow/tensorboard installed to render it?
As a next step, do you think its possible to also strip out the rendering part?

from .event_pb2 import SessionLog
from .event_pb2 import TaggedRunMetadata
# pylint: enable=unused-import
from tensorflow.python.framework import dtypes as _dtypes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like tf installation is still required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_dtypes is used in audio, and I think it could be easily pull off from TF. Since we haven't support audio yet, so I'm going to comment/remove these lines, but I will try to support all features of TensorBoard later.

# pylint: disable=unused-import
from tensorflow.python.ops.summary_ops import tensor_summary
# pylint: enable=unused-import
from tensorflow.python.platform import tf_logging as _logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These doesn't seem very essential. Is it possible to get rid of it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, my bad. It could be removed.

@zihaolucky
Copy link
Member Author

@piiswrong Yes, the current part is for logging part, the goal is to make it clean from TF. However, users have to install TensorFlow/TensorBoard to visualize the result as we haven't build it alone.

The next step is to build TensorBoard alone and together with MXNet (to strip out the rendering part), so users could easily use MXNet and this visualization tool without installing TF. I'm happy to contribute more to DMLC or MXNet and maintain it, but let me figure out how to strip TensorBoard and build it from source first. Thank you!

@piiswrong
Copy link
Contributor

@zihaolucky Sounds good.
For now lets open a new repo tensorboard for you because we can't have mxnet depend on tensorflow.

The idea situation would be we have a python package tensorboard that can be used independently to log and render (without necessarily requiring a mxnet or tf installation)

@piiswrong
Copy link
Contributor

@mli Could you create the repo for zihao?

@piiswrong
Copy link
Contributor

Just a thought: consider if its possible to do this in a way so that we can easily pull new changes from upstream.

@zihaolucky
Copy link
Member Author

@piiswrong Thanks for your suggestion. I've thought about this and it's indeed the ideal way.

I think we have the same opinion on 'using TensorBoard in MXNet without import tensorflow'(that's weird XD), and this PR mainly focus on the easier and faster way to let our users use this cool visualization tool without import tensorflow in their MXNet code, they just need import tensorboard which we have already provided in MXNet as a python package(as you suggest, that's the logging part).

As for the rendering part(step two), I have to pull out all relevant code of TensorBoard and put it in DMLC/TensorBoard and figure out a way to keep it easy to update with its original, cause TensorBoard could actively update and we have to keep it easy-to-maintain.

Discussion: Possible solution of building TensorBoard(the rendering part)

As I noticed in installing tensorflow:

pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl

and TensorBoard's doc:

Or, if you are building from source:
bazel build tensorflow/tensorboard:tensorboard

So is it a good/possible way to provide tensorboard like this? Then user install MXNet, they just need a tensorboard in requirements.txt which could be easily installed by pip install dmlc/tensorboard? I mean if we could write a script to strip the relevant code of TensorBoard from TF and make it a .whl file so all we have to do it's to maintain this script. As it's too difficult to maintain a bunch of code and keep it same with the upstream.

Just an immature idea, do you think it's possible?

@zihaolucky
Copy link
Member Author

zihaolucky commented Dec 10, 2016

Hi @piiswrong

I've removed the useless tensorflow dependencies and move this package under python as you suggested. But http://107.23.36.180:8080/job/mxnet/750/consoleText reports some protobuf issues, where I should compile and put these files? And how about the python/setup.py? There're some other warnings like indentation, I shall fix later.

Consider merge this logging part first when we clear the issues above, then I can move to the rendering part.

@piiswrong
Copy link
Contributor

piiswrong commented Dec 10, 2016

@zihaolucky Lets put this is a standalone repo first and consider merging it into mxnet later since you shouldn't spend too much time worrying about passing test in the beginning.

so you should have a dmlc/tensorboard repo with structure like this:

tensorboard
    python -- this PR
    src -- the next step
    Makefile -- build protobuf and src

You can start a repo on you own and transfer it to DMLC.

@mli
Copy link
Member

mli commented Dec 10, 2016

i created a dmlc/tensorboard repo and a team tensorboard-dev that has admin permission to this repo, hope it helps

@zihaolucky
Copy link
Member Author

I get it. @piiswrong @mli Thank you again!

@piiswrong piiswrong closed this Dec 14, 2016
@zihaolucky zihaolucky deleted the feature/tensorboard-support-experiment branch March 5, 2017 12:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants