美文网首页
报错module 'tensorflow' has no att

报错module 'tensorflow' has no att

作者: ZeroZone零域 | 来源:发表于2018-10-22 19:50 被阅读0次

    报错原因可能是因为当前路径下存在有与tensorlfow官方库相冲突的文件名,解决办法有2个。

    1、更改掉有冲突性质的名字

    这里如果你回忆一下在创建了哪个文件以后产生报错,然后将那个文件的名字更改一下就行了。
    以我自己为例,我这里创建了一个queue.py的文件,然后运行时就报这个错误了,并且不只是这个文件,在当前路径下的其他py文件也不能正常运行,但是如果换一个文件夹路径,运行其他文件夹下的py文件是没有问题的。
    所以这里我把queue.py改名成了q.py(其他名字也行),然后在运行,就不会报错了

    2、tensorlfow本身问题

    如果你不管在什么路径下运行任何还有tensorflow代码的文件,都会报错的话,建议使用指令重装TF:

    pip3 uninstall tensorflow-gpu#卸载
    
    pip3 install --upgrade tensorflow-gpu #安装
    

    相关文章

      网友评论

          本文标题:报错module 'tensorflow' has no att

          本文链接:https://www.haomeiwen.com/subject/hlcnzftx.html