Successful resolution AttributeError: module 'tensorflow.compat' has no attribute 'v1'

Successful resolution AttributeError: module 'tensorflow.compat' has no attribute 'v1'

 

 

table of Contents

Solve the problem

Solution


 

 

 

Solve the problem

AttributeError: module 'tensorflow.compat' has no attribute 'v1'

 

 

 

 

Solution

Because in tf2 version, using tf1 the API.

#     with tf.compat.v1.Session(graph=graph) as sess:
    with tf.Session(graph=graph) as sess:

 

 

 

 

Guess you like

Origin blog.csdn.net/qq_41185868/article/details/104000037