学习图神经网络中遇到的问题:
一、报错原因
下面展示一些 内联代码片。
由于代码包更新变动,适用于tf 1.x 不再使用于 tf 2.x版本
# 原先多的错误代码
import tensorflow as tf
flags = tf.app.flags
FLAGS = flags.FLAGS
**#出现报错:AttributeError: module 'tensorflow' has no attribute 'app'
或者AttributeError: module 'tensorflow' has no attribute flags**
二、解决办法
下面展示一些 内联代码片。
稍微修改
import tensorflow as tf
flags = tf.compat.v1.flags
FLAGS = flags.FLAGS
即可解决上述报错问题
有其他问题可以及时在评论区交流
635

被折叠的 条评论
为什么被折叠?



