Reputation: 143
I am using the new version of tensorflow (2.0.0 alpha) and I dont know why it does not allow me to run:
tf.get_variable_scope().reuse_variables()
I am getting the following error:
AttributeError: module 'tensorflow' has no attribute 'get_variable_scope'
I guess there is a new attribute with a different name? Thanks!
Upvotes: 3
Views: 6703
Reputation:
From comments
No,
variable_scope
andget_variable
have been removed fromTensorFlow 2.x
(although you can still find them under tf.compat.v1). InTF 2.x
to returns the current variable scope you can usetf.compat.v1.get_variable_scope
instead ofget_variable_scope
. For more details please refer Migrate from TF1 to TF2. (paraphrased from jdehesa).
Upvotes: 1