Skip to content
This repository was archived by the owner on Mar 25, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,41 @@ conda, run
$ conda install six, numpy, wheel, protobuf
```

### Build

### Prepare envronment for Windows

#### Install Protocol Compiler

Note that this requires [Protocol Buffers 3](https://developers.google.com/protocol-buffers/?hl=en) compiler, so please install it as follows:
1. Download the windows version (protoc-xxxx-win32.zip) and extract (do not use spaces in the folder name e.g. C:/protoc-buffer)
2. Add the protocol buffer bin folder to the windows PATH (e.g. C:/protoc-buffer/bin).

#### Install MS Visual Studio
bazel requires visual studio to be installed. The [Visual Studio Community](https://www.visualstudio.com/vs/community/) free version can be used.
After installation, make sure the installation is OK by running a Hello World C example.
You need to install Windows SDK for Windows 8 (available as an option within the installation of Visual Studio).

#### Install Anaconda
Install [Anaconda](https://www.continuum.io/downloads). Use installer for python 2.7.
- Install for current user only to avoid permission issues.
- Select the installation root directory to be C:/Anaconda2 (to avoid spaces).
- Make it the default system python2.7 (option avilable through the installation).

#### Install bazel for windows
This is the [bazel-windows](https://bazel.build/versions/master/docs/install-windows.html) installation instructions.
The simplest method is to use [chocolatey](https://chocolatey.org/) windows package manager. To install chocolatey follow this [link](https://chocolatey.org/install)).
- You may need to execute "Set-ExecutionPolicy Unrestricted" before installation.
- After chocolatey is installed , run "choco install bazel" command. It will install bazel dependencies (python27, JDK and MSYS) and then installs bazel. The python27 is not required since Anaconda will be used.

After bazel is installed, apply the following system configurations:
1. Create a Windows Environment Variable BAZEL_SH=path/to/MSYS/bash(typically it will be C:\tools\msys64\usr\bin\bash.exe).
2. Add the MSYS bin (e.g. c:\tools\msys64\usr\bin) to the windows PATH at its start (before references to windows shell paths).
3. Create an environment variable JAVA_HOME=path/to/jdk (e.g. C:\Program Files\Java\jdk1.8.0_121).
4. bazel will automatically configure BAZEL_VS and BAZEL_PYTHON after it starts.
5. When bazel is running, it will search for python27.lib (actually the visual studio linker does). It is located under (C:/Anaconda2/libs). The Visual Studio must be able to see python27.lib in any of its search paths. This is can be done by copying python27.lib under one of the default search paths for visual studio built-in libs e.g. C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64). If there is a way to let VS see C:/Anaconda2/libs, it would be better.


### Build (Non-Windows)

After that, to build the first part, simply:

Expand All @@ -82,7 +116,6 @@ $ cd tensorboard
$ sh installer.sh
# In this process, it might need configuration or failed in bazel build, just retry the specific step.
```

#### Configure the installation

For example(just type ’N’ for all case as we don’t need them):
Expand All @@ -96,6 +129,24 @@ Do you wish to build TensorFlow with GPU support? [y/N] N
Do you wish to build TensorFlow with OpenCL support? [y/N] N
```

### Build on Windows
For Windows run "bash installer_windows.sh" from cmd.exe

```bash
C:\>cd tensorboard
C:\tensorboard>bash installer_windows.sh
# In this process, it might need configuration or failed in bazel build, just retry the specific step.
```

#### Configure the installation
After running the installer_windows.sh, the configuration options will appear. Type 'N' for all options since they are not needed.
Just use "C:/Anaconda2/python.exe" as the location of python.
```bash
$ ./configure
Please specify the location of python. [Default is /usr/bin/python]:C:/Anaconda2/python.exe
```
After installation is OK (both tensorboard and tensorboard.runfiles are successfully generated under `tensorboard/tensorflow/bazel-bin/tensorflow/tensorboard`) go to tensorboard/python and type `python setup.py install`

## Usage
`dmlc/tensorboard` contains two parts in general, currently we have [Python interface](https://github.com/dmlc/tensorboard/tree/master/python)
for writing/logging `scalar`, `histogram` and `image` data to `EventFile`, which the front-end load data from this event file for visualization.
Expand All @@ -118,4 +169,4 @@ $ tensorboard --logdir=path/to/logs

You might want to see the development note of this project at our DMLC blog: [Bring TensorBoard to MXNet](http://dmlc.ml/2017/01/07/bring-TensorBoard-to-MXNet.html)

Feel free to contribute your work and don't hesitate to discuss in issue with your ideas.
Feel free to contribute your work and don't hesitate to discuss in issue with your ideas.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-cayman
30 changes: 30 additions & 0 deletions installer_windows.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

# make protobufs for logging part first
make all

# get tensorflow
git clone https://github.com/tensorflow/tensorflow
cd tensorflow

# run configuration.
bash configure --prefix=/mingw
Copy link
Member

Choose a reason for hiding this comment

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

Why prefix here?

Copy link
Author

Choose a reason for hiding this comment

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

This the only thing worked with me. Without this, I got bazel build errors.
See Reference


# build tensorboard
#bazel build tensorflow/tensorboard:tensorboard
bazel build -c opt --cpu=x64_windows_msvc --host_cpu=x64_windows_msvc --copt="/w" --verbose_failures tensorflow/tensorboard:tensorboard

# prepare pip installation package
cp -r ../tools/* bazel-bin/tensorflow/tools/

# get .whl file in python/dist/
bash bazel-bin/tensorflow/tools/pip_package/build_pip_package.sh ../python/dist/
Copy link
Member

Choose a reason for hiding this comment

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

In build_pip_package.sh, .runfiles in Windows are placed in a different location. But I forgot to handle this in tensorboard-binary.patch, could you take a look? Just take a look at the tensorboard binary and try to handle runfiles location in FindModuleSpace.


# install tensorboard package from .whl file
cd ..
pip install python/dist/*.whl

# clean up
echo 'Now you can remove tensorflow with rm -rf tensorflow'
#rm -rf tensorflow/

2 changes: 1 addition & 1 deletion python/tensorboard/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def image(tag, tensor):
def make_image(tensor, height, width, channel):
"""Convert an numpy representation image to Image protobuf"""
image = Image.fromarray(tensor)
output = StringIO.StringIO()
output = StringIO() # This is working for python 2.7
Copy link
Member

Choose a reason for hiding this comment

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

Why change this? Any error in the origin code?

Copy link
Member

Choose a reason for hiding this comment

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

I use python 2.7 and it's ok.

Copy link
Author

Choose a reason for hiding this comment

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

I am using Anaconda python 2.7. I got errors with this error AttributeError: class StringIO has no attribute 'StringIO'
When I made the modification, it is working.

Copy link
Member

Choose a reason for hiding this comment

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

Let me test this in my env, thanks.

image.save(output, format='PNG')
image_string = output.getvalue()
output.close()
Expand Down
1 change: 1 addition & 0 deletions windows_bin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Windows 10 tensorboard build output
Binary file added windows_bin/tensorboard
Binary file not shown.
Binary file added windows_bin/tensorboard.runfiles.7z
Binary file not shown.