问题: tf.compat.v1.variable_scope 报错 module 'tensorflow' has no attribute 'variable_scope'
毕设卡住了qwq
源代码是tensorflow1的,但是Google cola只能用2,把源代码“tf.variable_scope”改成“tf.compat.v1.variable_scope”还是报错
毕设卡住了qwq
源代码是tensorflow1的,但是Google cola只能用2,把源代码“tf.variable_scope”改成“tf.compat.v1.variable_scope”还是报错
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
需要屏蔽掉v2版本方法,不知道你添加了没。
引用自tensorflow2报错AttributeError: module ‘tensorflow‘ has no attribute ‘variable_scope‘