Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
| deeplearning:docker [2019/01/25 14:26] – admin | deeplearning:docker [2019/02/05 12:48] (Version actuelle) – [Terminologies] admin | ||
|---|---|---|---|
| Ligne 6: | Ligne 6: | ||
| In this tutorial we will learn how to use docker with GPU by running a simple Tesnforflow program. | In this tutorial we will learn how to use docker with GPU by running a simple Tesnforflow program. | ||
| </ | </ | ||
| + | |||
| + | ===== Terminologies ===== | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| We will the latest TF GPU images. | We will the latest TF GPU images. | ||
| Ligne 19: | Ligne 25: | ||
| <code bash> | <code bash> | ||
| $ docker pull tensorflow/ | $ docker pull tensorflow/ | ||
| + | </ | ||
| + | Before running a container, we suppose that we have a folder named '' | ||
| + | |||
| + | <code bash> | ||
| + | $ ls . | ||
| + | app | ||
| </ | </ | ||
| Ligne 27: | Ligne 39: | ||
| </ | </ | ||
| Woot! we gain root shell inside the container! | Woot! we gain root shell inside the container! | ||
| + | |||
| + | * **-it** means interactive | ||
| + | * **-- rm** means delete the container when finished | ||
| + | |||
| + | |||
| + | |||
| + | Newt we try to list files inside the container: | ||
| + | <code bash> | ||
| + | root@af31168ce2e5:/ | ||
| + | 1_hello_tensorflow.ipynb | ||
| + | </ | ||
| + | These files are inside the containers. Host files ('' | ||
| + | |||
| + | We can run directly python shipped withe container: | ||
| + | <code bash> | ||
| + | $ nvidia-docker run -it --rm tensorflow/ | ||
| + | Python 2.7.12 (default, Dec 4 2017, 14: | ||
| + | [GCC 5.4.0 20160609] on linux2 | ||
| + | Type " | ||
| + | >>> | ||
| + | |||
| + | </ | ||
| + | |||
| + | Lets try to access to our folder '' | ||
| + | <code bash> | ||
| + | $ nvidia-docker run -it --rm -v app:/app tensorflow/ | ||
| + | # ls /app | ||
| + | tfexample.py | ||
| + | </ | ||
| + | * '' | ||
| + | |||
| + | Now, we can run directly our '' | ||
| + | |||
| + | <code bash> | ||
| + | $ nvidia-docker run -it --rm -v app:/app tensorflow/ | ||
| + | </ | ||
| + | |||
| + | By default this image run jupyter notebook if no program is given. **BUT** we need to expose the used port '' | ||
| + | <code bash> | ||
| + | nvidia-docker run -it --rm -v app:/app -p8888:8888 tensorflow/ | ||
| + | [I 14: | ||
| + | [I 14: | ||
| + | [I 14: | ||
| + | [I 14: | ||
| + | [I 14: | ||
| + | [C 14: | ||
| + | | ||
| + | Copy/paste this URL into your browser when you connect for the first time, | ||
| + | to login with a token: | ||
| + | http:// | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | Replace '' | ||
| + | |||
| + | |||
| + | {{ : | ||
| + | |||
| + | One can the open and run notebook files. For more information about how to use Jupyter notebook please visit this page: | ||