Fixing error ” AttributeError: ‘module’ object has no attribute ‘global_variables_initializer'”

For the following TensorFlow error:

 AttributeError: 'module' object has no attribute 'global_variables_initializer'

You need to do a find and replace, of “global_variables_initializer” to “tf.initialize_all_variables” (this was changed in an upgrade)

2 Replies to “Fixing error ” AttributeError: ‘module’ object has no attribute ‘global_variables_initializer'””

  1. Thank you! Almost ended up installing an older Tensorflow version, but this saved a lot of time

Leave a Reply

Your email address will not be published. Required fields are marked *