当前位置:   article > 正文

Tensorflow版本问题报错_module 'tensorflow' has no attribute 'variable

module 'tensorflow' has no attribute 'variable

Tensorflow报错整理

  1. AttributeError: module ‘tensorflow’ has no attribute ‘set_random_seed’
    解决方案:tensorflow2.0将set_random_seed改成了tf.random.set_seed()
  2. AttributeError: module ‘tensorflow’ has no attribute 'placeholder
    解决方案:版本问题,强制使用tensorflow1.0
    import tensorflow.compat.v1 as tf
    tf.disable_v2_behavior()
  3. tensorflow 2.1.0: has no attribute ‘random_normal’
    解决方案:改成了tf.random.normal
  4. module ‘tensorflow’ has no attribute ‘variable_scope’
    解决方案:Replace “tf.variable_scope” with “tf.compat.v1.variable_scope”
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/569667
推荐阅读
相关标签
  

闽ICP备14008679号