运行论文源代码常遇到:AttributeError: module 'tensorflow' has no attribute 'Session'。
这种问题基本都是tensorflow版本不一致。论文用的是1.X,自己机器可能是2.0.
解决方法:
在一开始不要import tensorflow as tf,
而是import tensorflow.compat.v1 as tf
就OK了。
运行论文源代码常遇到:AttributeError: module 'tensorflow' has no attribute 'Session'。
这种问题基本都是tensorflow版本不一致。论文用的是1.X,自己机器可能是2.0.
解决方法:
在一开始不要import tensorflow as tf,
而是import tensorflow.compat.v1 as tf
就OK了。