Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Support and Documentation #17

Closed
mohamedmansour opened this issue Nov 9, 2015 · 180 comments
Closed

Windows Support and Documentation #17

mohamedmansour opened this issue Nov 9, 2015 · 180 comments
Assignees

Comments

@mohamedmansour
Copy link

mohamedmansour commented Nov 9, 2015

I was excited to see tensorflow, but as many other users, we are on Windows, would be nice to see this support happen. Will you accept Windows port contributions?

In the meantime, Microsoft recently released their Deep Learning toolkit which scales on multiple machines with GPUs for both Linux and Windows. https://github.com/Microsoft/CNTK

@janerivi
Copy link

janerivi commented Nov 9, 2015

I think its a great suggestion!

@mysticuno
Copy link

Same, I was kind of disappointed to see no mention of Windows in the download and install page.

@ObviouslyGreen
Copy link

Anyone have an idea of what the major incompatibilities/accommodations are? Is it it mostly issues with file paths, etc?

It's built with Bazel, which only supports linux/mac, but the good news is that windows support for bazel seems will be out by the end of this year.

@gordon-n-stevenson
Copy link

👍

@Andy-P
Copy link

Andy-P commented Nov 10, 2015

You can already use TensorFlow on a Windows machine by using Docker.
Details are in this thread.
#42

@AaronFriel
Copy link

I would like to use TensorFlow on Windows without Docker, in order to use GPU compute. Using Docker in this case is not using a Windows container, but a Linux virtual machine on Hyper-V or VirtualBox, and so the GPU will not be passed through.

@keon
Copy link

keon commented Nov 10, 2015

👍

This was referenced Nov 10, 2015
@darkAlert
Copy link

google, give us windows support , please!

@chai2010
Copy link

+1/0.0

@surban
Copy link

surban commented Nov 10, 2015

+1

@bayerj
Copy link

bayerj commented Nov 10, 2015

Yeah, windows support would be super nice.

@KennyVan
Copy link

+1
+1
+1

yes please

@sfiruch
Copy link

sfiruch commented Nov 10, 2015

Would love to use TensorFlow on Windows (native, not in a VM).

@ahmadia
Copy link

ahmadia commented Nov 10, 2015

I'll take a look into whether Continuum can provide a conda package for tensorflow.

@sibleyd
Copy link

sibleyd commented Nov 10, 2015

Judging by the use of bazel across the documentation, I assume its a matter of waiting for bazel to support windows. Is there anything specific to Tensorflow that would need to be addressed for windows to be supported, or is just bazel?

@ahmadia
Copy link

ahmadia commented Nov 10, 2015

One question I have is when Bazel support is actually arriving on Windows. Looking at the Bazel repository it says they are planning to support Android in Windows, but I didn't see any reference to building (what I assume are) native packages.

@davidzchen
Copy link
Contributor

Here is the bug we are using to track Bazel support for Windows: bazelbuild/bazel#276. A month ago, @dslomov was able to get Bazel to bootstrap itself on Windows. The plan is to finish Windows support by end of this year.

@sibleyd
Copy link

sibleyd commented Nov 11, 2015

@davidzchen I was actually working with that repo earlier this afternoon to try and give it a go without much luck, I might play around with it some more to see if I can get it to successfully bootstrap itself.

@datashinobi
Copy link

+1 native support on windows should be available

@y1yang0
Copy link

y1yang0 commented Nov 13, 2015

+1

@jakesays-old
Copy link

or maybe we could port it to a more reasonable build system. perhaps cmake.

@aebk2015
Copy link

@ahmadia do you have any tips on how to install tensorflow using conda?

@ahmadia
Copy link

ahmadia commented Nov 13, 2015

Right now we're in the same boat as everybody else because there is no port of TensorFlow to Windows. If somebody can put together a Windows port I'm happy to help with the binary build/deployment. Somebody has already put together a recipe for OS X/Linux available with conda install -c memex tensorflow.

@nguyenquyhy
Copy link

+1 for this

@zandaqo
Copy link

zandaqo commented Nov 3, 2016

@erivaldojunior By compiling the examples do you mean this: MSBuild /p:Configuration=Release tf_tutorials_example_trainer.vcxproj? I did that before compiling the pip package. It compiles to .\Release, is that the folder to add to path? I have just tried adding it, but no luck so far.

I do see files named pywrap_tensor mentioned in the errors in that .\Release folder, maybe manually copying them somewhere might help Python to see them. Not sure where though.

@ghost
Copy link

ghost commented Nov 3, 2016

@zandaqo, that is right. I just add that Release folder to my Windows path and it worked. However, I tested by launching python my_tensorflow_script.py from a CMD window. I don't know if it work if you use some kind of IDE or iPython.

@zandaqo
Copy link

zandaqo commented Nov 3, 2016

@erivaldojunior Thanks, you were right about missing DLLs, though in my case it turned out to be zlib.dll that was missing from both the package and .\Release folder. I've manually copied zlib.dll into the folder, as it was suggested here and the import now works.

@icoxfog417
Copy link

I successed to build the tensorflow! But cmake 3.3.1 causes build error, 3.6.3 works fine.

@martinwicke
Copy link
Member

Good to know! We'd welcome a PR with an appropriate minimum version
statement in the cmakelist file.

On Saturday, November 5, 2016, Takahiro Kubo notifications@github.com
wrote:

I successed to build the tensorflow! But cmake 3.3.1 causes build error,
3.6.3 works fine.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAjO_Ys4MI03pcc3tCR_BzsqIXFrQTTcks5q7RVRgaJpZM4GexU4
.

Carmezim added a commit to Carmezim/tensorflow that referenced this issue Nov 7, 2016
@Carmezim
Copy link
Contributor

Carmezim commented Nov 7, 2016

@martinwicke as in here it seems the minimum known working Cmake version is 3.5. Should I change minimum requirement to 3.5 and update the readme for minimum 3.5 up to 3.6?

@komoku
Copy link

komoku commented Nov 7, 2016

Nice to see that TensorFlow can now work on Windows with GPU now. Are there plans for a version that need not be installed from sources? And if so, any ETA on that? It would be great if the setup process were as straightforward as on Linux, I'm using TensorFlow on Linux without problems and would like to do so on Windows, but the requisites and setup process documented in the readme currently looks a bit cumbersome for those of us that don't have much time...

@meteorcloudy
Copy link
Member

meteorcloudy commented Nov 7, 2016

Hey guys! With the release of Bazel 0.4.0, TensorFlow PIP package can now build with Bazel on Windows.
Thanks to @petemounce's contribution, you can use choco install bazel --version 0.4.0 to install Bazel easily.

@gunan has already set up a ci job for it: http://ci.tensorflow.org/job/tensorflow-pr-win-bazel/
Basically, we are using this script. So with proper modification to the environment variables (if your installations of Visual Studio, Python 3 or msys is not at the standard places), you'll be able to build the PIP package with Bazel as well!

Update: I would recommend to run the commands in the script manually if you have trouble running it directly.

@KonstantinKhabarlak
Copy link
Contributor

@meteorcloudy Thanks for update!
Build with bazel did not work for me. I get ERROR: CreateFile(C:\tmp\Bazel\44EoGNou\install)
Any way to debug that? I have localized windows (russian), maybe that's the cause

Full log. Running in PowerShell as admin:

C:\libs\tensorflow>c:\tools\msys64\usr\bin\bash -l C:\libs\tensorflow/tensorflow/tools/ci_build/windows/cpu/pip/build_tf_windows.sh
+ set -e
++ dirname 'C:\libs\tensorflow/tensorflow/tools/ci_build/windows/cpu/pip/build_tf_windows.sh'
+ script_dir='C:\libs\tensorflow/tensorflow/tools/ci_build/windows/cpu/pip'
+ cd 'C:\libs\tensorflow/'
+ export TMPDIR=C:/tmp
+ TMPDIR=C:/tmp
+ export BAZEL_SH=C:/tools/msys64/usr/bin/bash
+ BAZEL_SH=C:/tools/msys64/usr/bin/bash
+ export 'PYTHON_BIN_PATH=C:\tools\Anaconda3/python'
+ PYTHON_BIN_PATH='C:\tools\Anaconda3/python'
+ export 'BAZEL_PYTHON=C:\tools\Anaconda3/python'
+ BAZEL_PYTHON='C:\tools\Anaconda3/python'
+ export 'BAZEL_VS=C:/Program Files (x86)/Microsoft Visual Studio 14.0'
+ BAZEL_VS='C:/Program Files (x86)/Microsoft Visual Studio 14.0'
+ export 'PATH=/c/tools/bazel:/c/Program Files/Anaconda3:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/'
+ PATH='/c/tools/bazel:/c/Program Files/Anaconda3:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/'
+ bazel clean
Extracting Bazel installation...
ERROR: CreateFile(C:\tmp\Bazel\44EoGNou\install): ▒▒ ▒▒▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒ ▒▒▒▒.
 (2)
.....................................................................................................................................................................................................................................................................................................................................
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
++ bazel info output_base
+ output_base=C:/tmp/Bazel/44EoGNou
+ bazel shutdown
+ rm -rf C:/tmp/Bazel/44EoGNou
rm: невозможно удалить 'C:/tmp/Bazel/44EoGNou/server/jvm.out': Device or resource busy

@petemounce
Copy link

petemounce commented Nov 7, 2016

@KhabarlakKonstantin That's (ERROR: CreateFile(C:\tmp\Bazel\44EoGNou\install)) bazelbuild/bazel#1744 I think. It only happens the first time after bazel is installed. There don't seem to be any repercussions.

@meteorcloudy
Copy link
Member

@KhabarlakKonstantin As @petemounce pointed out, you can safely ignore that error. And you can also skip rm -rf C:/tmp/Bazel/44EoGNou if the Device or resource busy error is blocking you. I guess it's because it tried to remove jvm.out before jvm fully shutdown after invoking bazel shutdown.

@KonstantinKhabarlak
Copy link
Contributor

@petemounce @meteorcloudy Thanks for help
The problem is that it doesn't start building. I've commented out bazel shutdown and it goes now a little bit furhter, but still crashes

INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
++ bazel info output_base
+ output_base=C:/tmp/Bazel/44EoGNou
+ echo ''
+ ./configure
/c/libs/tensorflow /c/libs/tensorflow
Found possible Python library paths:
  C:\Program Files\Anaconda3\lib\site-packages
  C:\Program Files\Anaconda3
Please input the desired Python library path to use.  Default is [C:\Program Files\Anaconda3\lib\site-packages]
Using python library path: C:\Program Files\Anaconda3\lib\site-packages
Junction created for util\python\python_include <<===>> C:\Program Files\Anaconda3\include
Junction created for util\python\python_lib <<===>> C:\Program Files\Anaconda3\lib\site-packages
Junction created for third_party\py\numpy\numpy_include <<===>> C:\Program Files\Anaconda3\lib\site-packages\numpy\core\include

No more output here

@meteorcloudy
Copy link
Member

@KhabarlakKonstantin It seems OpenCL configuration is just added into ./configure but not turned off by default on Windows, so please manually run that script or add export TF_NEED_OPENCL=0 before echo "" | ./configure

pcloudy@PCLOUDY1-W MSYS ~/workspace/tensorflow
$ ./configure
~/workspace/tensorflow ~/workspace/tensorflow
Please specify the location of python. [Default is /c/Program Files/Anaconda3/python]:
Found possible Python library paths:
  C:\Program Files\Anaconda3\lib\site-packages
  C:\Program Files\Anaconda3
Please input the desired Python library path to use.  Default is [C:\Program Files\Anaconda3\lib\site-packages]

Using python library path: C:\Program Files\Anaconda3\lib\site-packages
Junction created for util\python\python_include <<===>> C:\Program Files\Anaconda3\include
Junction created for util\python\python_lib <<===>> C:\Program Files\Anaconda3\lib\site-packages
Junction created for third_party\py\numpy\numpy_include <<===>> C:\Program Files\Anaconda3\lib\site-packages\numpy\core\include
Do you wish to build TensorFlow with OpenCL support? [y/N] n
No OpenCL support will be enabled for TensorFlow
Configuration finished

@Carmezim
Copy link
Contributor

Carmezim commented Nov 8, 2016

Is anybody else having these errors with Pragma (ignore pywrap one)?

Building with GPU and all specs in accord to readme.

@ghost
Copy link

ghost commented Nov 8, 2016

@Carmezim, it worked fine for me. I did not get any of these errors.

@guschmue
Copy link
Contributor

guschmue commented Nov 8, 2016

I have a pr to fix this here: #5421

@Carmezim
Copy link
Contributor

Carmezim commented Nov 8, 2016

@guschmue Nice! Thanks for the quick response

@splinter89
Copy link

After fixing _Pragma, this is what I get in the same file:

C:/tensorflow/tensorflow/core/kernels/parameterized_truncated_normal_op_gpu.cu.cc(168): error : more than
one operator "/" matches these operands: [C:\tensorflow\tensorflow\contrib\cmake\build\tf_core_gpu_kernels.v
cxproj]

@guschmue
Copy link
Contributor

guschmue commented Nov 8, 2016

#5421 will fix this as well.

@edwin100394
Copy link

Can I build with GPU support using bazel?

@gunan
Copy link
Contributor

gunan commented Nov 8, 2016

@edwin100394 no GPU support on windows using bazel yet.
We are still working on it.

On Mon, Nov 7, 2016 at 9:33 PM, edwin100394 notifications@github.com
wrote:

Can I build with GPU support using bazel?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHlCOXNRNoMFmnSPfnkTMLsRHcIcl9TXks5q8AmigaJpZM4GexU4
.

@KonstantinKhabarlak
Copy link
Contributor

@meteorcloudy Adding export TF_NEED_OPENCL=0 helped me to go a little further

Now I'm getting another error:

ERROR: C:/libs/tensorflow/tensorflow/core/BUILD:1115:1: Executing genrule //tensorflow/core:version_info_gen failed: bash failed: error executing command
  cd C:/tmp/Bazel/44EoGNou/execroot/tensorflow
  SET PATH=C:\tools;C:\tools\Anaconda;C:\tools\msys64\usr\local\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\opt\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\tools\msys64\usr\bin\site_perl;C:\tools\msys64\usr\bin\vendor_perl;C:\tools\msys64\usr\bin\core_perl
  C:/tools/msys64/usr/bin/bash -c source external/bazel_tools/tools/genrule/genrule-setup.sh; tensorflow/tools/git/gen_git_source.py --generate tensorflow/tools/git/gen/spec.json tensorflow/tools/git/gen/head tensorflow/tools/git/gen/branch_ref "bazel-out/vc_14_0_x64-py3-opt/genfiles/tensorflow/core/util/version_info.cc": com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1
Traceback (most recent call last):
  File "tensorflow/tools/git/gen_git_source.py", line 260, in <module>
    generate(args.generate)
  File "tensorflow/tools/git/gen_git_source.py", line 212, in generate
    git_version = get_git_version(data["path"])
  File "tensorflow/tools/git/gen_git_source.py", line 152, in get_git_version
    str("--work-tree=" + git_base_path), "describe", "--long", "--dirty", "--tags"
  File "C:\tools\Anaconda\lib\subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "C:\tools\Anaconda\lib\subprocess.py", line 693, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\tools\Anaconda\lib\subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "C:\tools\Anaconda\lib\subprocess.py", line 1224, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 10.997s, Critical Path: 3.44s
FAILED: Build did NOT complete successfully

@KonstantinKhabarlak
Copy link
Contributor

I've started from scratch and I've build bazel from sources. Now it building almost till the end

It fails at link time in the end:

ERROR: C:/libs/tensorflow/tensorflow/python/BUILD:1907:1: Linking of rule '//tensorflow/python:_pywrap_tensorflow.so' failed: msvc_link.bat failed: error executing command
  cd C:/tmp/Bazel/44EoGNou/execroot/tensorflow
  SET PATH=external/local_config_cc/wrapper/bin
  external/local_config_cc/wrapper/bin/msvc_link.bat /DLL /WHOLEARCHIVE -pthread -m64 -Xcompilation-mode=opt -Wl,@bazel-out/vc_14_0_x64-py3-opt/bin/tensorflow/python/_pywrap_tensorflow.so-2.params: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1169
Warning: Unmatched arguments: -ldl -lm -ldl -lm
Warning: Unmatched arguments: -pthread
libversion_lib.a(version_info.o) : error LNK2005: "char const * __cdecl tf_compiler_version(void)" (?tf_compiler_version@@YAPEBDXZ) already defined in libframework_internal.lo(version_info.o)
libversion_lib.a(version_info.o) : error LNK2005: "char const * __cdecl tf_git_version(void)" (?tf_git_version@@YAPEBDXZ) already defined in libframework_internal.lo(version_info.o)
   Creating library bazel-out/vc_14_0_x64-py3-opt/bin/tensorflow/python/_pywrap_tensorflow.lib and object bazel-out/vc_14_0_x64-py3-opt/bin/tensorflow/python/_pywrap_tensorflow.exp
bazel-out/vc_14_0_x64-py3-opt/bin/tensorflow/python/_pywrap_tensorflow.so : fatal error LNK1169: one or more multiply defined symbols found
ERROR: C:/libs/tensorflow/tensorflow/python/BUILD:639:1: output 'tensorflow/python/gen_control_flow_ops_py_wrappers_cc.exe' was not created
ERROR: C:/libs/tensorflow/tensorflow/python/BUILD:698:1: output 'tensorflow/python/gen_resource_variable_ops_py_wrappers_cc.exe' was not created
Target //tensorflow/tools/pip_package:build_pip_package failed to build

@mrry
Copy link
Contributor

mrry commented Nov 9, 2016

Hi folks, now that rudimentary Windows support is in place, I am going to lock this issue for new comments, but keep it open until we have a stable release. Going forward:

  • If you have an issue, please open a new issue against TensorFlow to describe your problem, and fill out the standard issue template. This will help us to track and assign the remaining work that we have to do to get TensorFlow-on-Windows released.
  • We will continue to use this issue for (rare) announcements about Windows support, so you can continue to subscribe to the issue for a low-traffic feed about improvements to TensorFlow-on-Windows.

Once again, thanks for all your interest in TensorFlow-on-Windows, and now we're going to get back to work!

@tensorflow tensorflow locked and limited conversation to collaborators Nov 9, 2016
@mrry
Copy link
Contributor

mrry commented Nov 29, 2016

Today we announced native Windows support in TensorFlow 0.12, with packages for Python 3.5. If you have installed the 64-bit version of Python 3.5 (either from Python.org or Anaconda), you can install TensorFlow with a single command:

C:\> pip install tensorflow

For GPU support, if you have CUDA 8.0 installed, you can install the following package instead:

C:\> pip install tensorflow-gpu

Now that Windows is a supported configuration, I'm going to close this issue; please open a new issue if you have problems with these packages. There are still some discrepancies between the Windows package and the other platforms, which are outlined in the release notes. We'll be working over the next few weeks to close these gaps.

Thanks for all of your interest in TensorFlow on Windows!

@mrry mrry closed this as completed Nov 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests