I am getting the following errors:
AttributeError: module 'tensorflow' has no attribute 'variable_scope'
AttributeError: module 'tensorflow' has no attribute 'squared_difference'
tensorflow is installed:
>> pip3 list | grep tensorflow
tensorflow 2.0.0
tensorflow-estimator 2.0.1
TensorFlow 2.0 cleaned up some of the APIs. Mathematical functions such as squared_difference()
are now under tf.math
.
There is no tf.variable_scope()
in TensorFlow 2.0. I suggest reading this post with examples on how to migrate your code to TF2.
If you want your code to be compatible with older versions of TensorFlow, you can use tf.compat.v1.variable_scope()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With