-
Notifications
You must be signed in to change notification settings - Fork 74.4k
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
Building custom op instructions out of date #13607
Comments
Sorry about that. The "adding an op" docs are updated at head (and will go live once 1.4 is released), but right now there's a bit of a mismatch. The important bits:
And add to the compiler flags: It is also possible to build with --config=monolithic if you want to load custom ops with RTLD_GLOBAL in Python (should work just as it did pre-1.4). |
@MarkDaoust maybe we should add a little warning on some of these docs that they're versioned, with a link to head? |
Thanks, that fixed it! Looks like desired alignment in latest tf is 32 |
it did not work. there is no My |
I add both TF_INC and TF_LIB but still cannot fix it. |
@twmht that library path comes from a version before TensorFlow 1.4; maybe you have a couple different Python installations with different TensorFlow versions? @JuiHsuan-Kuo which TensorFlow version, and what's the error? Note that the updated documentation for 1.4+ is at https://www.tensorflow.org/versions/master/extend/adding_an_op |
Are there relevant/accurate instructions for 1.3.0? I am seeing the same issue as @twmht with lack of tensorflow_framework from my 1.3.0 install. |
If I do upgrade to 1.4.0 (which my codebase cannot support) I am able to build the shared object and avoid the missing kernel call but then I'm faced with
|
@bearrito What's the context for that ImportError? Importing TensorFlow? |
After messing around w/ the DYLD and LD lib paths, I ended up just brute forcing it.... bazel build --config=cuda //tensorflow/tools/lib_package:libtensorflow And then just used linkopt bazel build -c opt --config=cuda //dragnn/core:gen_dragnn_bulk_ops_py_wrappers_cc --verbose_failures --linkopt=/opt/tensorlibs/lib/libtensorflow_framework.so |
How about the build instructions for GPU ops. Tensorflow tutorials even never mention it. @allenlavoie I find one here, but it also meets the same problem |
flags for building ops changed in october 2017: tensorflow/tensorflow#13607 i got the new flags from https://www.tensorflow.org/guide/extend/op#compile_the_op_using_your_system_compiler_tensorflow_binary_installation compiling gives lots of warnings about alignments being off, but all tests pass
I'm using tf.14. I get the same error when running a custom op: undefined symbol: _ZTIN10tensorflow8OpKernelE when I compile using this flag: -L$TF_LIB -ltensorflow_framework, I get this error: |
I am having the exact same issue |
I resolved the issue after spending days of scraping the internet to compile a custom tf op. I am including the steps that I had to take for other people to use.
|
@kasrayazdani, sorry I missed your first post. That does not sound like fun. There appears to be a new repository for this: https://github.com/tensorflow/custom-op I will see if I can delete the old doc and just leave a pointer to this new repo. |
yaroslavvb |
My tensorflow construction order :
I also made a custom op for myself, but
Can anyone help me? |
Hi @yaroslavvb ! Have you checked latest document on a registering a custom op from 2.8 version yet? Thanks! |
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
@anirudh161 has been working on this with some of our engineers. |
Ok @MarkDaoust ! Reopening this issue then. Thank you! |
Marking this issue as resolved as there has been no activity on it. Please open a new issue if you're facing issues with creating custom ops. Thanks! |
Following instructions here
https://www.tensorflow.org/extend/adding_an_op
To try to rebuild this op
First I ran into issue with nsync headers, fixed by following
#12482 (comment)
Then while trying to load the
.so
file I run intotensorflow.python.framework.errors_impl.NotFoundError: ./max_align_bytes_op.so: undefined symbol: _ZTIN10tensorflow8OpKernelE
So the definition for
tensorflow::OpKernel
is missingtf commit: 22a886b
cc @allenlavoie
The text was updated successfully, but these errors were encountered: