TensorFlow 'module' object has no attribute 'global_variables_initializer'

前端 未结 4 584
日久生厌
日久生厌 2021-02-05 01:51

I\'m new to Tensorflow I\'m running a Deep learning Assignment from Udacity on iPython notebook. link

And it has an error.

AttributeError                         


        
4条回答
  •  野性不改
    2021-02-05 02:28

    In Tensorflow 2.0 , it does away from session and switches to eager execution. You can still run your code using session if you refer to tf.compat library and disable eager execution. This command should do the work:

    tf.compat.v1.global_variables_initializer()
    

提交回复
热议问题