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
Tensorflow tutorial MNST.py runs from Docker command line, but errors from Dockerized iPython notebook #415
Comments
Update: If instead of executing the file via exec() from within the Jupyter notebook, I paste the code into the notebook first and then evaluate, it runs with no errors. |
Looks like the tensorflow code forcefully exits the process in which it's running after main completes. This isn't friendly to using it in a notebook, but is working as designed at the moment. |
Aha! Thanks, Peter! |
I have the exact same problem. I run Python 3.6 and tensorflow v.1.2 on Mac OS Sierra 10.12.6. I tried to copy-paste the entire code the the Jupyter notebook but I get the same error. When I run the code in the terminal everything worked just fine. Is there something I need to do in order to get the code running via Jupyter? (I want to ass that I am very new to Python) |
I have the same error when I run the minst_softmax.py of tensorflow in the Anaconda. |
the error occurred at the code : |
This error can ignore, for there is not affecting my program. |
I am not sure if that is completely correct, but what I think is happening is that the code on tensorflow website was written so that it can be compiled from a terminal. When I tried to run it from a jupyter notebook it was giving me an error, but when I removed the last two lines of the code, defined a dummy variable |
I am launching
jupyter/tensorflow-notebook
viasudo docker run -v /home/jeff/code/tflow:/home/jovyan/work -it --rm -p 8888:8888 jupyter/tensorflow-notebook
. That causes bash to print some things, including a link. I click that link to open a Jupyter Notebook in Chrome.The sample MNST problem in the Tensorflow tutorials runs fine from the command line within that docker container:
However, from the notebook in Chrome, the same command (
exec(open("./mnst.py").read())
) prints the following to screen:Notice that it ran the program! Or at least close to it. From the command line it printed 0.9171, and from the notebook, 0.9179. The error only came after it printed that out -- and that print command is the last line of main() in mnst.py.
If I then evaluate
%tb
as the error suggests, I get the following:The text was updated successfully, but these errors were encountered: