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

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

目录

解决问题

解决方法


解决问题

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

扫描二维码关注公众号,回复: 9498491 查看本文章

解决方法

因为在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