Written by
Sangwan Kwon
on
on
Setting tensorflow using docker on mac OS
Environment Setting
- Pull tensorflow image.
$ docker pull tensorflow/tensorflow
3-1. Launch a docker container that contains one of the tensorflow images.
$ docker run -it tensorflow/tensorflow bash
3-2. Test tensorflow sample code.
$ python … >>> import tensorflow as tf >>> hello = tf.constant(‘Hello, TensorFlow!’) >>> sess = tf.Session() >>> print sess.run(hello) Hello, TensorFlow! >>>
Coding with docker container
- Code and test on docker.
$ docker cp sample.py ts-guide:/sample
- Exit docker.
- Save docker image.
$ docker ps -a $ docker commit b4e3ed4abdc9 ts-guide
- Confirm saved docker image as browser
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=f7af48d3d0078a1a09edda55533197d44baabe8011b89a79