dmlc / tensorboard

Standalone TensorBoard for visualizing in deep learning
Apache License 2.0
370 stars 60 forks source link

Windows PyPI support and installer script test #23

Open zihaolucky opened 7 years ago

zihaolucky commented 7 years ago

As we have Win users, I'm going to:

As I haven't used windows for a while, it might take some time. Anyone could help and contribute in this direction?

zihaolucky commented 7 years ago

@ahmedezzateasa Just follow this issue and we're looking for your feedback.

ahmedezzat85 commented 7 years ago

@zihaolucky I can successfully run the installer.sh on Windows 10.

System Description

Windows 10 x64 Visual Studio Community 2015 Anaconda 2 (for python 2.7) bazel 0.4.5 MSYS 2

Build Steps

I followed the steps in README . These are the steps with some Details:

Install Protocol Buffer 3

  1. Download the windows version (the latest is protoc-3.2.0-win32.zip) and extract it to a folder with no spaces (e.g. C:\protoc-win32).
  2. Add the protocol buffer bin dir (C:/protoc-win32/bin) to windows PATH.

Install MS Visual Studio Community Edition

bazel requires visual studio to be installed. There is a free edition "Visual Studio Community" for open source development. I am using 2015 version, 2017 also will be OK. Create a C Hello World example to check there is no missing packages and the installation is OK. You need to install Windows SDK for Windows 8 (within the installation of Visual Studio).

Install bazel for windows

The best method to install bazel is to use chocolatey package manager for windows. The steps are:

  1. Install Anaconda. Use 64-bit 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.
  2. Install chocolatey (Follow this link).
    • Use Windows PowerShell as Administrator.
    • Execute Set-ExecutionPolicy Unrestricted
  3. Run "choco install bazel" command. It will install bazel dependencies (python27, JDK and MSYS) and then installs bazel. The python27 is not required since we will use Anaconda.
  4. After successful installation, follow the instructions at the end of the installation for configuring the bazel environment variables.
  5. Create a Windows Environment Variable BAZEL_SH=path/to/MSYS/bash(typically it will be C:\tools\msys64\usr\bin\bash.exe).
  6. Add the MSYS bin (e.g. c:\tools\msys64\usr\bin) to the windows PATH at its start (before references to windows shell paths).
  7. Create an environment variable JAVA_HOME=path/to/jdk (e.g. C:\Program Files\Java\jdk1.8.0_121).
  8. bazel will automatically configure BAZEL_VS and BAZEL_PYTHON after it starts.
  9. When bazel is running, it will search for python27.lib (actually the visual studio linker does). It is located under (C:/Anaconda2/libs). I cannot make it visible to VS by any environment variables (neither LIB nor LIBPATH). The only thing worked for me, is copying it 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)

Tensorboard Installation

  1. Clone the tensorboard repository.
  2. Modify the installer.sh as follows:
    • Replace "bash configure" with "bash configure --prefix=/mingw"
    • Modify the bazel command to be in the form "bazel build -c opt --cpu=x64_windows_msvc --host_cpu=x64_windows_msvc --copt="/w" --verbose_failures tensorflow/tensorboard:tensorboard"
  3. Open a Windows cmd.exe from the tensorboard repo directory and run "bash installer.sh".
  4. Wait untill the process finished.
  5. Continue as in README .
ahmedezzat85 commented 7 years ago

One more thing. When I run python setup.py, the tensorboard/src directory is not copied to the python package installation directory. It must be manually copied. The tensorboard binary is nice. no patches are required (maybe the latest tensorflow head fixes windows issues with tensorboard)

ahmedezzat85 commented 7 years ago

I uploaded my changes to this fork --> https://github.com/ahmedezzateasa/tensorboard

zihaolucky commented 7 years ago

@ahmedezzateasa Great! How about creating a PR, I believe this would help Windows users. Besides, you can also change the README.

ZhaoxiaZhang commented 7 years ago

@ahmedezzateasa I'm a Windows user.My current env is Windows 7 , python 3.6. I followed your step and it seems to install bazel, python 2.7 is installed too. However, when I run window_install.sh, It gave a lot of errors..