当前位置:   article > 正文

报错:AttributeError: module ‘******‘ has no attribute ‘******‘等问题解决_attributeerror: module 'linear' has no attribute '

attributeerror: module 'linear' has no attribute 'coef

出现报错:

解决方法:

一、在command页面直接安装第三方库

pip install xxxxxx

 二、在pycharm 左下角选择Interpreter Setting,再点击加号,输入第三方库名称,然后点击左下角Install Pakage,安装即可。

 三、2.x版本的tensorflow不支持很多第三方库,我试了很多种办法,还是觉得直接安装1.x版本的最直接有效(简单粗暴)。对应的,可能需要将numpy降版本因为安装的tensorflow版本和numpy版本不匹配。

先卸载tensorflow:

pip uninstall tensorflow

 再安装新版本:

pip install tensorflow1.xx

 查看pycharm适应版本,再安装: 

pip install tensorflow==1.14 -i https://pypi.douban.com/simple

 当运行代码后,报错提示numpy版本不匹配时:

比如,我出现了一下报错: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint32 = np.dtype([("qint32", np.int32, 1)])

建议安装:或其他版本

pip install numpy==1.16.0

 后,正常运行。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/225004?site
推荐阅读
相关标签
  

闽ICP备14008679号