-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Fix for #12537 #15173
Fix for #12537 #15173
Conversation
Can one of the admins verify this patch? |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
I am going to defer to API review first, and possibly someone else who works on TF core team should be a real reviewer. |
The concerns I have are; API bloat, and internally our logging infrastructure under the LOG macros do a lot of extra helpful things relevant to Google-infrastructure that std:cerr would lose. I don't know how to rectify these things easily, even though I like the spirit of your change. Perhaps this is a candidate for a custom op; it's not clear that we can make "Print" work generically for all environments in the world, and trying will just make Print more complicated than it needs to be. |
Another solution would be to have an environment variable like TF_CPP_MIN_LOG_LEVEL that modifies the underlying fprintf tensorflow/tensorflow/core/platform/default/logging.cc Lines 88 to 91 in 4ad1204
Also is it a bug or feature that TF_CPP_MIN_LOG_LEVEL can disable tf.Print? |
@asimshankar and I chatted offline, there may be a simpler solution to this, but he'll have to pass it by the API review folks first. It's a feature to allow users to completely disable all logging via LOG(INFO), and perhaps a bug that tf.Print uses LOG(INFO) in the OSS build. |
@Johanju : Thanks for the contribution. We feel that instead of adding a new API, it might be okay to just change the implementation of the Thoughts? |
@asimshankar This is my first PR so I will just follow your lead, It won't be any problem the Google-infrastructure angel that @vrv talked about? What do you think is better between std::cerr and std::cout in this case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have built the fix on x86 linux no gpu and it's working.
There are some android specific code in logging that I ignored.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/platform/default/logging.cc#L35-L75