tensorflow 在docker中输出hello world

$ docker pull tensorflow/tensorflow
Using default tag: latest
latest: Pulling from tensorflow/tensorflow
18d680d61657: Pull complete
0addb6fece63: Pull complete
78e58219b215: Pull complete
eb6959a66df2: Pull complete
4263945a5710: Pull complete
282d99d903f2: Pull complete
dd620fc3ae28: Pull complete
aa8e48babf4b: Pull complete
27c088fb1ccc: Pull complete
ca88730530b5: Pull complete
5f530f9c7fc4: Pull complete
8ea52f77069e: Pull complete
Digest: sha256:ce5416e416bac281e600fa0bf3aac250514287ed31055d0d06742a4e8332dc89
Status: Downloaded newer image for tensorflow/tensorflow:latest
$ docker run -it tensorflow/tensorflow
[I 11:53:27.774 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 11:53:27.800 NotebookApp] Serving notebooks from local directory: /notebooks
[I 11:53:27.800 NotebookApp] The Jupyter Notebook is running at:
[I 11:53:27.800 NotebookApp] http://(fafc6c773304 or 127.0.0.1):8888/?token=3599a3d660ade03fafcfcd16165132e7c8f340585d84a3c6
[I 11:53:27.800 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:53:27.801 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://(fafc6c773304 or 127.0.0.1):8888/?token=3599a3d660ade03fafcfcd16165132e7c8f340585d84a3c6

^C[I 11:53:45.354 NotebookApp] interrupted
Serving notebooks from local directory: /notebooks
0 active kernels
The Jupyter Notebook is running at:
http://(fafc6c773304 or 127.0.0.1):8888/?token=3599a3d660ade03fafcfcd16165132e7c8f340585d84a3c6
Shutdown this notebook server (y/[n])? y
[C 11:53:48.680 NotebookApp] Shutdown confirmed
[I 11:53:48.681 NotebookApp] Shutting down 0 kernels
~$ docker run -it tensorflow/tensorflow bash
root@99a758aef080:/notebooks#
root@99a758aef080:/notebooks#
root@99a758aef080:/notebooks# python
Python 2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello=tf.constant("hello world")
>>> se=tf.Session()
2018-12-13 11:54:48.327058: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

>>> print(se.run(hello))
hello world
>>>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值