nvdia-docker-tensorflow

版权声明:本文为博主 一銤阳光 学习整理的文章,如需转载,请注明出处、附上CSDN博文链接。 https://blog.csdn.net/CSDNhuaong/article/details/84728011

install

sudo docker pull tensorflow/tensorflow:latest-gpu-py3

start

sudo docker run --runtime=nvidia -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3

test

from __future__ import print_function
import tensorflow as tf

with tf.Session():
    input1 = tf.constant([1.0, 1.0, 1.0, 1.0])
    input2 = tf.constant([2.0, 2.0, 2.0, 2.0])
    output = tf.add(input1, input2)
    result = output.eval()
    print("result: ", result)

result:  [3. 3. 3. 3.]

猜你喜欢

转载自blog.csdn.net/CSDNhuaong/article/details/84728011