上代码:

import tensorflow as tf

if __name__=='__main__': 
    g = tf.Graph()   
    # add ops to the user created graph
    with g.as_default(): 
        hello = tf.constant('Hello Tensorflow') 
        sess = tf.compat.v1.Session(graph=g)
        print(sess.run(hello)) 

输出如下图右侧:

 

说明:python3.7.4 ,tensorflow2.0 

 

 若对您有用,请赞助个棒棒糖~

 

posted on 2019-11-28 16:44  十行道人  阅读(527)  评论(0编辑  收藏  举报