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)

Interested in Python? I send out weekly, personalized emails with articles and conference talks. Click here to see an example and subscribe.

2 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

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