Closed ankur6ue closed 4 years ago
/CC @mrry is there any documentation on how to do this?
Thanks for the quick reply. I'm not looking for a nicely written doc (although that would be great). Just any code that can be compiled on windows to produce a dll/so that can be loaded into python as an external op would suffice.
For example, in the current tensorflow for windows distribution, there are some dlls that appear to implement external ops _lstm_ops.dll in site-packages\tensorflow\contrib\rnn\python\ops
Instructions on how to build these dlls would be great. I'd imagine the procedure would be similar for other external ops.
As you might have guessed, there's no nicely written doc (this feature was a community contribution, and lavish documentation is too high a bar...). However, here's a link to where the _lstm_ops.dll
and _gru_ops.dll
extensions get built, so if you're familiar with CMake you might be able to figure out what's going on:
Thanks, but I'm not a cmake expert and the code to build the external ops is deeply embedded in the cmake file.. It is not clear how to run just that part of the cmake file standalone in a way that produces the ops binary without building the entire tensorflow source code.
I don't need a nicely written doc, just a make file that can be run in a windows environment and builds an external op dll without building all of tensorflow. I'd think this would be a common request among tensorflow users on windows..
Only Windows programmers could make a simple process overly convoluted and complex. Building an external Tensorflow op under Linux is as simple as invoking a single gcc command.
Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.
The Problem:
Using TensorFlow version 1.3.0 on Windows 10.
Thanks for providing a windows port for Tensorflow. Is there an example that shows how to compile external C/C++ code into a so/dll that can be loaded by tensorflow as an external op (without building entire tensorflow source) on Windows? The word2vec code that builds word2vec_ops.so/dll would be a great example..
This thread seems to suggest that this is possible now: https://github.com/tensorflow/models/issues/1103
Incidently, I also tried building TensorFlow from source on windows. It almost works, but I get the following when I run: MSBuild /p:Configuration=Release tf_python_build_pip_package.vcxproj, as suggested on the build from source on windows using cmake readme (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/cmake/README.md)
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.