安装tensorflow过程中的报错

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

SystemError:

安装tensorflow过程中的报错

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

在安装②期间遇到新错误:

[En]

A new error was encountered during ② installation:

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成功

安装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运行,代码运行正常!

Original: https://blog.csdn.net/weixin_54693379/article/details/124656688
Author: 深度学习,深度睡眠
Title: 安装tensorflow过程中的报错

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/496364/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球