栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

安装tensorflow过程中的报错

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

安装tensorflow过程中的报错

①安装tensorflow后,测试安装是否成功,结果报错:


SystemError: returned a result with an error set

 原因:安装tensorflow时没有选择版本(我是输入pip install tensorflow安装的),系统默认安装最新版本2.8,而python版本为3.7,不兼容导致,tensorflow与python版本要对应
解决办法:对tensorflow降级重新安装(pip install tensorflow-GPU==2.5),安装2.5版本的tensorflow,

②安装过程中遇到新报错:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
cryptography 3.3.2 requires cffi>=1.12, but you have cffi 1.11.5 which is incompatible.

百度一下,安装joblib(pip install joblib)和scikit-learn(pip install scikit-learn)后重新安装tensorflow成功

 

③在Jupyter运行代码时又报错:
module 'keras.engine.base_layer' has no attribute 'BaseRandomLayer'
module 'tensorflow.compat.v2.__internal__.tracking' has no attribute 'no_automatic_dependency_tracking'

重新将tensorflow降级到2.0,keras降级到2.3,tensorflow与keras版本也要对应

④打开anaconda-jupyter运行代码,居然报错找不到包,原因是anaconda不同环境不共享包,
打开cmd,输入jupyter notebook运行,代码运行正常!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/869229.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号