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: Adding a new op #19122

Closed
deepin17 opened this issue May 7, 2018 · 6 comments
Closed

Windows: Adding a new op #19122

deepin17 opened this issue May 7, 2018 · 6 comments
Labels
stat:contribution welcome Status - Contributions welcome

Comments

@deepin17
Copy link

deepin17 commented May 7, 2018

Please go to Stack Overflow for help and support:

https://stackoverflow.com/questions/tagged/tensorflow

If you open a GitHub issue, here is our policy:

  1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
  2. The form below must be filled out.
  3. It shouldn't be a TensorBoard issue. Those go here.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):windows7
  • TensorFlow installed from (source or binary):binary
  • TensorFlow version (use command below):1.8.0
  • Python version: 3.6
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):6.4.0
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
I use pip to install tensorflow, but there is no library I need to compile my op.

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.
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') ) TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') ) g++ -std=c++11 -shared zero_out.cc -o zero_out.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2 /usr/bin/ld: 找不到 -ltensorflow_framework collect2: 错误:ld 返回 1

@PatWie
Copy link

PatWie commented May 8, 2018

You will need to figure out the correct ABI using tf.__cxx11_abi_flag__ and set the following env-vars

"\"%s/libtensorflow_framework.so\")\n" % tf.sysconfig.get_lib()
tf.sysconfig.get_include()

But you will run into another new issue #18841 and hence you'll need the git-repository and compile TF from source.

@deepin17
Copy link
Author

deepin17 commented May 9, 2018

@PatWie I have searched ‘libtensorflow_framework.so' on my computer and I can not find it which may not be installed. I have tried reinstalling TF many times. However, I got the same result. Must I install TF from source if I want to add my op?

@asimshankar
Copy link
Contributor

asimshankar commented May 19, 2018

Sorry for the trouble, we do want to make sure that the documentation is correct and useful.

Are you following https://www.tensorflow.org/extend/adding_an_op#compile_the_op_using_your_system_compiler_tensorflow_binary_installation ?

Could you include a minimum, complete, verifiable example to reproduce the problem?

Though, I see you're using Windows. In Windows, there is no equivalent of libtensorflow_framework.so, we compile a single monolithic library for it right now.
(CC @allenlavoie )

@asimshankar asimshankar added the stat:awaiting response Status - Awaiting response from author label May 19, 2018
@deepin17
Copy link
Author

@asimshankar
https://tensorflow.google.cn/extend/adding_an_op#compile_the_op_using_your_system_compiler_tensorflow_binary_installation

I am following the tutorial except this step because of the lack of the file 'libtensorflow_framework.so'

@asimshankar
Copy link
Contributor

@deepin17 : I see, thanks for the update.

Honestly, we don't have the bandwidth/expertise to update the documentation for compiling custom operations for Windows (and also, the libtensorflow_framework shared library doesn't exist there).

I took the liberty to update the issue title to more closely reflect that.
And we'd sincerely appreciate contributions from the community. Ideally, someone would chime in with a pull request to update the instructions for Windows.

Marking this as "Contributions Welcome" for this purpose.

@asimshankar asimshankar added stat:contribution welcome Status - Contributions welcome and removed stat:awaiting response Status - Awaiting response from author labels May 21, 2018
@asimshankar asimshankar changed the title Do not have the library needed to add a new op Windows: Adding a new op May 21, 2018
@asimshankar asimshankar removed their assignment May 21, 2018
@asimshankar
Copy link
Contributor

asimshankar commented May 21, 2018

Also see tensorflow/models#1103 (comment)

(CC @guschmue as an FYI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:contribution welcome Status - Contributions welcome
Projects
None yet
Development

No branches or pull requests

3 participants