Reputation: 33
My problem:
Newbie to the ML field here. I am currently attempting to set up tensorflow through docker but am having some troubles getting to the jupyter notebook once tensorflow appears to be running. For future reference, I am using windows 10, powershell, python 2.7, and oracle virtualbox (v.5.0.16).
I am pretty confident that docker is working properly because I went through their setup tutorial ("Using docker from Powershell") without any issues--I was able to run the hello world example there just fine. I was also able to successfully run an ubuntu terminal with the command
docker run -it ubuntu bash
I then followed the tensorflow docker installation instructions and everything appeared to be normal--I entered the docker run command for tensorflow:
docker run -it b.gcr.io/tensorflow/tensorflow
and got this output:
[I 19:33:16.330 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 19:33:16.360 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[W 19:33:16.360 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended.
[I 19:33:16.365 NotebookApp] Serving notebooks from local directory: /notebooks
[I 19:33:16.365 NotebookApp] 0 active kernels
[I 19:33:16.365 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/
[I 19:33:16.366 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
However, when I attempt to get to the jupyter notebook at localhost:8888, chrome says the site cannot be reached within a few seconds and that the server refused to connect.
Solutions I have tried:
Followed the advice in this stackoverflow post. When I run the command they suggest to start a new tensorflow container, I get the error:
exec: "./run_jupyter.sh": stat ./run_jupyter.sh: no such file or directory
docker: Error response from daemon: Container command not found or does not exist..
I also changed the port settings using virtualbox like they suggested, and this also did not seem to make a difference.
Instead of going to localhost, I tried the IP addresses listed for the driver when I use the command docker-machine ls. No luck here either.
My first attempt was using the quickstart terminal that comes with docker, and I got stuck in the same place. So now I have a "default", from when I set up docker using the quickstart terminal, and a "my-default", from when I set up docker using powershell. Stackexchange comments have said that the quickstart terminal doesn't work as well as just using powershell, so I have started using powershell instead.
Tried changing which driver was active using docker-machine env and then running the tensorflow run command for that driver's IP address, and still had no luck.
Tried skipping the jupyter notebook and just running everything from the command line through python as suggested in the next step of the tensorflow install ("Run tensorflow from the command line") and I could not even import tensorflow from there:
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
I don't know if this is possible without running jupyter first but I thought it was worth a shot. This problem might be unrelated to the one this post is about, but if anyone has an idea as to why this is, that would be helpful too.
I appreciate any and all help that is offered. Please let me know if anything I stated is vague, or if I can offer any more details on what I have tried. Thank you very much in advance.
Upvotes: 3
Views: 3983
Reputation: 2116
Try adding -p 8888:888 to the docker run command.
docker run -p 8888:8888 -it b.gcr.io/tensorflow/tensorflow
Found the solution in this tensorflow issue, in a comment by HWiese1980
Since Docker usually needs to have the same operating system on the Docker host system as it's in the Docker container (well, parts that is) you need a Linux VM to run a Docker container that is based on Linux under Windows. Docker itself opens port 8888 between the VM and the container. You have to explicitly tell it to forward the port from the outside of the VM to the open Docker container port by using said parameter -p 8888:8888.
Upvotes: 2
Reputation: 805
For ubuntu 14.04 I had to use the below command to specify '/bin/bash' so that it would enter the interactive console.
docker run -it gcr.io/tensorflow/tensorflow /bin/bash
Upvotes: 1