-
Notifications
You must be signed in to change notification settings - Fork 327
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
Output Not Captured #7
Comments
Seems like probably an issue regarding how TF tells whether RStudio is an interactive environment. https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/platform/tf_logging.py#L55 |
Yes, |
Oh I see. Yea I am expecting the following as part of the output:
|
I think the problem may be here: You can that TF is trying to determine whether the session is interactive. In the case that it is it will pipe output to stdout (which we could then capture) however in the case where it's not it sends it to stderr. That relies on the state of |
Okay, the function is now renamed This should get you what you are looking for, let me know if it doesn't. |
Thanks, will try! |
Closing this. Feel free to re-open if you have additional issues. |
Just gave it a try. Still looks like not able to capture those output. Not a blocker though. |
I'd really like to get this resolved. Can you provide me the smallest
possible snippet of R code that exhibits the problem and I'll dig in
further?
…On Sun, Feb 12, 2017 at 12:55 PM, Yuan (Terry) Tang < ***@***.***> wrote:
Oh I see. Yea I am expecting the following as part of the output:
INFO:tensorflow:Create CheckpointSaverHook.
INFO:tensorflow:Saving checkpoints for 2 into /var/folders/ln/c7r_x26x46b7vzpftbfh64zc0000gp/T//RtmpbD66eR/tflearn_a32c5e4d2404/model.ckpt.
INFO:tensorflow:loss = 438.822, step = 2
INFO:tensorflow:global_step = 2
INFO:tensorflow:global_step = 6 (0.016 sec)
INFO:tensorflow:global_step = 10 (0.002 sec)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGXx_RHe-siWXcluMnCsXCExmM3uy5xks5rb0eogaJpZM4L-TQY>
.
|
Here it is:
|
Interesting, for me this actually successfully captures the output! Here's my exact code as executed (I think it's the same): library(tensorflow)
output <- reticulate::py_capture_output(tf$logging$warn("asdf")) Are you certain you've upgraded to the latest versions of tensorflow and reticulate? |
Yes, I've removed all packages and reinstalled everything. Otherwise |
What platform are you on?
…On Thu, Feb 16, 2017 at 7:01 PM Yuan (Terry) Tang ***@***.***> wrote:
Yes, I've removed all packages and reinstalled everything. Otherwise
py_capture_output won't be available in old versions.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#7 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGXx_bU8pU96XOCVHWN27EOiC4D9BTXks5rdONAgaJpZM4L-TQY>
.
|
Okay apologize that I didn't clean up my environment properly. That one worked as expected. However, here's what's weird:
Verbosity is set to info correctly but the output is not captured. Could you try if you can reproduce it? |
It looks to me like the INFO stream is bypassing stderr. If I write this then the output is correctly captured: output <- reticulate::py_capture_output({
sys <- import("sys")
sys$stderr$write("foo")
}) Are you just trying to prevent INFO messages from being printed at all? If so we could do something like we do for https://github.com/rstudio/tensorflow/blob/master/R/package.R#L35-L45 |
I am trying to capture a regex in the output. But it's not super important. I think this is an issue on the Python API end. I'll reopen if this turns out to be very critical. |
See this part of the code: https://github.com/rstudio/tflearn/blob/master/tests/testthat/test-hooks.R#L17
where the output doesn't seem to be captured using
py_capture_stdout
. Is this the correct way to use it? Thecapture.output
from R only captures the output for the return value oflinear_dnn_combined_regression
. Ispy_capture_stdout
able to capture loggings from TF?The text was updated successfully, but these errors were encountered: