成功解决AttributeError: module 'tensorflow.compat' has no attribute 'v1'

成功解决AttributeError: module 'tensorflow.compat' has no attribute 'v1'

目录

解决问题

解决方法


解决问题

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

解决方法

因为在tf2版本下,采用了tf1的API。

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

猜你喜欢

转载自blog.csdn.net/qq_41185868/article/details/104000037